-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add ameba #15875
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
Add ameba #15875
Changes from all commits
50e70ff
1d882f6
e838118
b422df3
71fe402
5887dad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,194 @@ | ||||||||
# This configuration file was generated by `ameba --gen-config` | ||||||||
# on 2025-06-02 13:57:07 UTC using Ameba version 1.7.0-dev. | ||||||||
# The point is for the user to remove these configuration records | ||||||||
# one by one as the reported problems are removed from the code base. | ||||||||
# | ||||||||
# For more details on any individual rule, run `ameba --only RuleName`. | ||||||||
|
||||||||
# Indicators for comment annotations: | ||||||||
# | ||||||||
# * `Disabled`: The rule is disabled because it does not seem useful for this repo (or in general). | ||||||||
# * `BUG`: A bug in ameba prevents using this rule either entirely or for specific files. | ||||||||
# * `FIXME`: The rule seems useful, but requires some effort to resolve. That's deferred for later. | ||||||||
# * `TODO`: The rule might be useful, but we need to investigate whether we want to use it or not. | ||||||||
|
||||||||
Version: "1.7.0-dev" | ||||||||
|
||||||||
# Documentation | ||||||||
# ========================= | ||||||||
|
||||||||
# Disabled: What's the point in alerting about existing TODOs in code? | ||||||||
Documentation/DocumentationAdmonition: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Lint | ||||||||
# ========================= | ||||||||
|
||||||||
Lint/DebugCalls: | ||||||||
Excluded: | ||||||||
# Samples may legitimately use DebugCalls | ||||||||
- samples/**/* | ||||||||
# Explicit tests | ||||||||
- spec/std/pp_spec.cr | ||||||||
|
||||||||
Lint/DebuggerStatement: | ||||||||
Excluded: | ||||||||
# Explicit tests | ||||||||
- spec/debug/**/* | ||||||||
|
||||||||
# Disabled: `else nil` can be useful to explicitly show the consequence of the else branch | ||||||||
Lint/ElseNil: | ||||||||
Enabled: false | ||||||||
|
||||||||
Lint/LiteralInCondition: | ||||||||
Excluded: | ||||||||
# Samples may legitimately use literals in conditions | ||||||||
- samples/**/* | ||||||||
|
||||||||
Lint/LiteralInInterpolation: | ||||||||
Excluded: | ||||||||
- spec/std/random_spec.cr # BUG: https://github.com/crystal-ameba/ameba/issues/611 | ||||||||
|
||||||||
Lint/LiteralsComparison: | ||||||||
Excluded: | ||||||||
# Explicit tests for case equality on tuple literals | ||||||||
- spec/std/tuple_spec.cr | ||||||||
|
||||||||
# TODO: Investigate if some `not_nil!` calls can be avoided. | ||||||||
Lint/NotNil: | ||||||||
Enabled: false | ||||||||
|
||||||||
Lint/RandZero: | ||||||||
Excluded: | ||||||||
# Explicit tests | ||||||||
- spec/std/random_spec.cr | ||||||||
|
||||||||
# FIXME: Resolve shadowing. | ||||||||
Lint/ShadowingOuterLocalVar: | ||||||||
Enabled: false | ||||||||
|
||||||||
# TODO: Investigate file names and move to data directories. | ||||||||
Lint/SpecFilename: | ||||||||
Enabled: false | ||||||||
|
||||||||
# BUG: https://github.com/crystal-ameba/ameba/issues/612 | ||||||||
Lint/TopLevelOperatorDefinition: | ||||||||
Enabled: false | ||||||||
|
||||||||
Comment on lines
+74
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been already fixed.
Suggested change
|
||||||||
# Disabled: We have an explicit CI job for `typos`. No reason to run it through | ||||||||
# ameba. | ||||||||
Lint/Typos: | ||||||||
Enabled: false | ||||||||
straight-shoota marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
|
||||||||
# TODO: Investigate unused arguments. | ||||||||
Lint/UnusedArgument: | ||||||||
Enabled: false | ||||||||
|
||||||||
# TODO: Investigate unused block arguments. | ||||||||
Lint/UnusedBlockArgument: | ||||||||
Enabled: false | ||||||||
|
||||||||
# FIXME: Investigate useless assigns. | ||||||||
Lint/UselessAssign: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Metrics | ||||||||
# ========================= | ||||||||
|
||||||||
# Disabled: Lot's of violations. Complexity is very individual. | ||||||||
Metrics/CyclomaticComplexity: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Naming | ||||||||
# ========================= | ||||||||
# All disabled. There are many violations and some of the rules are questionable. | ||||||||
# TODO: Consider enabling some of these rules. | ||||||||
|
||||||||
Naming/AccessorMethodName: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/BinaryOperatorParameterName: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/BlockParameterName: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Disabled: All violations follow the spelling of identifiers in upstream | ||||||||
# projects, e.g. for lib bindings. | ||||||||
Naming/ConstantNames: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/MethodNames: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/PredicateName: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/QueryBoolMethods: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/RescuedExceptionsVariableName: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/TypeNames: | ||||||||
Enabled: false | ||||||||
|
||||||||
Naming/VariableNames: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Performance | ||||||||
# ========================= | ||||||||
|
||||||||
Performance/AnyInsteadOfEmpty: | ||||||||
Excluded: | ||||||||
# These specs explicitly test `#any?` implementations | ||||||||
- spec/std/bit_array_spec.cr | ||||||||
- spec/std/enumerable_spec.cr | ||||||||
- spec/std/hash_spec.cr | ||||||||
|
||||||||
# Style | ||||||||
# ========================= | ||||||||
# All disabled. There are many violations and some of the rules are questionable. | ||||||||
# TODO: Consider enabling some of these rules. | ||||||||
|
||||||||
Style/HeredocEscape: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/HeredocIndent: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/MultilineCurlyBlock: | ||||||||
Enabled: false | ||||||||
|
||||||||
# Disabled: This rule seems too strict when any negation inside a complex condition is | ||||||||
# considered a violation. https://github.com/crystal-ameba/ameba/issues/621 | ||||||||
Style/NegatedConditionsInUnless: | ||||||||
Enabled: false | ||||||||
|
||||||||
# BUG: https://github.com/crystal-ameba/ameba/issues/614 | ||||||||
Style/ParenthesesAroundCondition: | ||||||||
Enabled: false | ||||||||
|
||||||||
Comment on lines
+168
to
+171
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix is only in master. Latest ameba release is still broken. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whole 1.7.0-dev is only in master, so... 🤷♂️ |
||||||||
Style/PercentLiteralDelimiters: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/RedundantBegin: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/RedundantNext: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/RedundantReturn: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/RedundantSelf: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/UnlessElse: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/VerboseBlock: | ||||||||
Enabled: false | ||||||||
|
||||||||
Style/WhileTrue: | ||||||||
Enabled: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,3 +113,12 @@ jobs: | |
uses: crate-ci/[email protected] | ||
env: | ||
CLICOLOR: 1 | ||
|
||
lint_ameba: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/crystal-ameba/ameba:sha-d861f4ed0f904e0ecdad11c26f98e968f7d95afa # 1.7.0-dev | ||
steps: | ||
- name: Download Crystal source | ||
uses: actions/checkout@v4 | ||
|
||
- run: ameba |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ lib Foo | |
end | ||
|
||
def raise(msg) | ||
while true | ||
while true # ameba:disable Lint/EmptyLoop | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was just fixed and landed in
master
.