-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to enable only the max_length
of variable_name
rule?
#541
Comments
Could you please use lowest threshold? variable_name:
max_length:
warning: 45
error: 60
min_length:
warning: 1 You can confirm how configuration is interpreted by swiftlint rules --config ~/.swiftlint-test.yml
Loading configuration from '/Users/norio/.swiftlint-test.yml'
+-----------------------------+--------+-------------+------------------------+--------------------------------------------------+
| identifier | opt-in | correctable | enabled in your config | configuration |
+-----------------------------+--------+-------------+------------------------+--------------------------------------------------+
| closing_brace | no | yes | yes | warning |
| colon | no | yes | yes | warning |
| comma | no | yes | yes | warning |
| conditional_binding_cascade | no | no | yes | warning |
| control_statement | no | no | yes | warning |
| custom_rules | no | no | yes | user-defined |
| cyclomatic_complexity | no | no | yes | warning: 10, error: 20 |
| empty_count | yes | no | no | error |
| file_length | no | no | yes | warning: 400, error: 1000 |
| force_cast | no | no | yes | error |
| force_try | no | no | yes | error |
| force_unwrapping | yes | no | no | warning |
| function_body_length | no | no | yes | warning: 40, error: 100 |
| function_parameter_count | no | no | yes | warning: 5, error: 8 |
| leading_whitespace | no | no | yes | warning |
| legacy_constant | no | yes | yes | warning |
| legacy_constructor | no | yes | yes | warning |
| line_length | no | no | yes | warning: 100, error: 200 |
| missing_docs | yes | no | no | warning: public |
| nesting | no | no | yes | warning |
| opening_brace | no | yes | yes | warning |
| operator_whitespace | no | no | yes | warning |
| return_arrow_whitespace | no | no | yes | warning |
| statement_position | no | yes | yes | warning |
| todo | no | no | yes | warning |
| trailing_newline | no | yes | yes | warning |
| trailing_semicolon | no | yes | yes | warning |
| trailing_whitespace | no | yes | yes | warning |
| type_body_length | no | no | yes | warning: 200, error: 350 |
| type_name | no | no | yes | (min_length) w/e: 3/0, (max_length) w/e: 40/1000 |
| valid_docs | no | no | yes | warning |
| variable_name | no | no | yes | (min_length) w: 1, (max_length) w/e: 45/60 |
+-----------------------------+--------+-------------+------------------------+--------------------------------------------------+ |
I don't want to enable this rule.
|
Oh, I understand. I thought only about length.
|
Thank you very much for your advice. |
This would have been possible before the merging of |
@scottrhoyt I'd love to see the alphanumeric rule become optional; we're porting a codebase to use SwiftLint now, and the more granular the rules, the smaller the PRs to do so. |
+1 For some reason this part of the rule just started firing when I converted the code to Swift 3. |
Was this eventually done? Another issue with this is some people define Rx Observable using a |
If nobody's working on this, I could try adding the configurations mentioned, and open a PR once they're ready 🙂 |
Fixed in #1444 |
Hello.
In SwiftLint at version v0.6.0 , I want only
variable_name_max_length
rule to be enabled.However, I do not know the settings for latest version.
Is there any method to only the
max_length
ofvariable_name
rule to be enabled?.swiftlint.yml
file.The text was updated successfully, but these errors were encountered: