We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$ swiftlint lint Loading configuration from '.swiftlint.yml' Linting Swift files in current working directory Linting 'WPReportView.swift' (1/10) Linting 'UIFont.swift' (2/10) Linting 'WPContext.swift' (3/10) Linting 'JTView.swift' (4/10) Linting 'UIColor+JT.swift' (5/10) Linting 'NSObject+JT.swift' (6/10) Linting 'WPTheme.swift' (7/10) Linting 'UIView+JT.swift' (8/10) Linting 'WPHeaderView.swift' (9/10) Linting 'WPHeaderItemView.swift' (10/10) /XXX/SDK/Views/WPHeaderItemView.swift:77:12: error: Empty Count Violation: Prefer checking `isEmpty` over comparing `count` to zero. (empty_count) Done linting! Found 1 violation, 1 serious in 10 files.
swiftlint version
0.25.1
# https://github.com/realm/SwiftLint/blob/master/Rules.md disabled_rules: - cyclomatic_complexity - function_body_length - file_length - identifier_name - line_length - todo - trailing_comma - type_body_length - unused_optional_binding opt_in_rules: - attributes - closure_end_indentation - closure_spacing - conditional_returns_on_newline - contains_over_first_not_nil - discouraged_object_literal - empty_count - fatal_error_message - first_where - joined_default_parameter - literal_expression_end_indentation - multiline_arguments - multiline_parameters - operator_usage_whitespace - overridden_super_call - redundant_nil_coalescing - sorted_first_last - sorted_imports - switch_case_on_newline - unneeded_parentheses_in_closure_argument - vertical_parameter_alignment_on_call - yoda_condition excluded: - Pods
xcode-select -p
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
echo "func updateErrors(count: Int) {\n if count > 0 {\n print(\"1\")\n } else {\n print(\"2\")\n }\n }" | swiftlint lint --no-cache --use-stdin --enable-all-rules
// This triggers a violation: func updateErrors(count: Int) { if count > 0 { print("1") } else { print("2") } }
I just use a variable named count I think it should not be catch by the empty_count rule.
count
The text was updated successfully, but these errors were encountered:
It's the same issue as #827. Check this comment: #827 (comment)
Sorry, something went wrong.
No branches or pull requests
New Issue Checklist
Bug Report
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? =>0.25.1
xcode-select -p
)? 9.3.1 (9E501)echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
I just use a variable named
count
I think it should not be catch by the empty_count rule.The text was updated successfully, but these errors were encountered: