Skip to content

Commit 9f8f8fc

Browse files
fix: commented_out_code rule regular expression
1 parent a5a528a commit 9f8f8fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.swiftlint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ opt_in_rules:
2929
- empty_string
3030
- closure_body_length
3131
- fallthrough
32+
- commented_out_code
3233

3334
# force warnings
3435
force_cast: error
@@ -39,7 +40,7 @@ custom_rules:
3940
included: ".*\\.swift" # regex that defines paths to include during linting. optional.
4041
excluded: ".*Test(s)?\\.swift" # regex that defines paths to exclude during linting. optional
4142
name: "Commented out code" # rule name. optional.
42-
regex: "^\\/\\/\\s*(@|\\.?([a-z]|(\\})))" # matching pattern
43+
regex: "^\\s*(\/\/(?!\\s*swiftlint:).*|\/\\*[\\s\\S]*?\\*\/)" # matching pattern
4344
capture_group: 0 # number of regex capture group to highlight the rule violation at. optional.
4445
match_kinds: # SyntaxKinds to match. optional.
4546
- comment

0 commit comments

Comments
 (0)