Skip to content

v1.7.0

Latest

Choose a tag to compare

@Sija Sija released this 26 Aug 10:32
· 15 commits to master since this release

Release in numbers

Our biggest release yet 🐳

  • Almost 3 years in the works
  • 333 closed issues/PRs
  • 37 new rules

What's Changed

Evolution

Warning

Breaking changes ahead!
Each is marked by the following sign: ⚠️

Community

With this release, we've grown more than just a version, as we've got a new team member@nobodywasishere ❤️

New website and domain

Ameba website has been redesigned and is now available at crystal-ameba.org.

New Rules

37 new rules added.

Lint

Style

Typing

Performance

Renamed Rules

  • Documentation/DocumentationAdmonition -> Documentation/Admonition rule by @Sija in #647 ⚠️
  • Lint/DuplicatedRequire -> Lint/DuplicateRequire rule by @Sija in #873 ⚠️

Deprecated Rules

  • Performance/AnyInsteadOfEmpty rule by @Sija in #846 ⚠️

Rules disabled by default

  • Documentation/Admonition rule by @Sija in #648 ⚠️
  • Lint/Typos rule by @Sija in #721 ⚠️

New Rule Options

  • Documentation/Documentation: Add RequireExample option by @Sija in #727
  • Lint/SpecFilename: Add IgnoredPaths option by @Sija in #850
  • Naming/BinaryOperatorParameterName: Add AllowedNames option by @Sija in #690
  • Style/ParenthesesAroundCondition: Add ExcludeMultiline option by @Sija in #649

Removed Rule Options

  • Lint/UselessAssign: Remove ExcludeTypeDeclarations option by @Sija in #769 ⚠️
  • Lint/SpecFilename: Remove IgnoredDirs option by @Sija in #850 ⚠️
  • Lint/SpecFilename: Remove IgnoredFilenames option by @Sija in #850 ⚠️

Rule Enhancements

  • Lint/RedundantStringCoercion: Add autocorrect by @Sija in #885
  • Lint/ShadowedArgument: Move to liveness analysis by @veelenga in #795
  • Lint/SharedVarInFiber: Move to liveness analysis by @veelenga in #795
  • Lint/UnreachableCode: Support control expressions in blocks by @Sija in #872, #889
  • Lint/UselessAssign: Refactor rule using liveness analysis by @veelenga in #785, #799, #805, #810
  • Naming/BlockParameterName: Add a and b to allowed name list by @Sija in #675
  • Naming/BlockParameterName: Add wg (WaitGroup) as allowed block parameter name by @mamantoha in #589
  • Naming/RescuedExceptionsVariableName: Add err to allowed name list by @Sija in #814
  • Performance/ChainedCallWithNoBang: Add unstable_sort to the call name list by @Sija in #558
  • Style/RedundantBegin: Apply the rule to blocks as well by @Sija in #865
  • Style/RedundantNext: Report if/unless branches with no else by @Sija in #820
  • Style/RedundantReturn: Report if/unless branches with no else by @Sija in #820

Improved Issue Locations

  • Tweak reported location of Documentation/Admonition issues by @Sija in #569
  • Tweak reported location of Lint/BadDirective issues by @Sija in #572
  • Tweak reported location of Lint/LiteralInCondition issues by @Sija in #574
  • Tweak reported location of Lint/PercentArrays issues by @Sija in #571
  • Tweak reported location of Lint/UnneededDisableDirective issues by @Sija in #573
  • Tweak reported location of Lint/UnreachableCode issues by @Sija in #870
  • Tweak reported location of Lint/UnusedArgument issues by @Sija in #657
  • Tweak reported location of Naming/BinaryOperatorParameterName issues by @Sija in #661
  • Tweak reported location of Naming/BlockParameterName issues by @Sija in #661
  • Tweak reported location of Naming/RescuedExceptionsVariableName issues by @Sija in #661
  • Tweak reported location of Naming/ShadowingOuterLocalVar issues by @Sija in #662
  • Tweak reported location of Naming/VariableNames issues by @Sija in #663
  • Tweak reported location of Style/RedundantNext issues by @Sija in #821
  • Tweak reported location of Style/RedundantReturn issues by @Sija in #821

Rule Bug Fixes

  • Layout/TrailingWhitespace: Do not report CRLF sequences by @Sija in #627
  • Lint/Formatting: Avoid IndexError when autocorrecting source with no trailing newline by @SAY-5 in #832
  • Lint/LiteralInInterpolation: Do not report magic constants by @Sija in #596
  • Lint/LiteralInInterpolation: Report only static literals by @Sija in #638
  • Lint/LiteralsComparison: Fix regression by @Sija in #630
  • Lint/LiteralsComparison: Skip dynamic literals comparison by @Sija in #633
  • Lint/SpecFocus: Do not report focus values which are calls or vars by @Sija in #606
  • Lint/UnneededDisableDirective: Rule fixes by @veelenga in #788
  • Lint/UnneededDisableDirective: Skip non-existent rules by @Sija in #808
  • Lint/UselessAssign: Avoid inheriting vars from outer scope in def by @straight-shoota in #625
  • Lint/UselessAssign: Do not report type declarations within calls by @Sija in #769, #776
  • Lint/UselessAssign: Fix scopes by @veelenga in #784
  • Lint/ShadowingOuterLocalVar: Do not flag block argument shadowing across mutually exclusive branches by @veelenga in #824
  • Lint/ShadowingOuterLocalVar: Do not flag block argument shadowing inside the initial assignment by @veelenga in #826
  • Lint/ShadowingOuterLocalVar: Avoid false positives across unconnected branches by @veelenga in #838
  • Lint/SpecFilename: Use Source#project_path property to get relative path by @Sija in #851, #854
  • Metrics/CyclomaticComplexity: Include unless in nodes counted by @Sija in #586
  • Naming/AccessorMethodName: Fix false-positives by @Sija in #716
  • Naming/ConstantNames: Fix reporting single-line constant assigns with namespaces by @nobodywasishere in #655
  • Performance/AnyInsteadOfPresent: Fix autocorrection bug by @Sija in #712
  • Style/ParenthesesAroundCondition: Fix autocorrection putting right parenthesis on newline when condition ends with implicit call by @FnControlOption in #548
  • Style/ParenthesesAroundCondition: Do not strip parentheses from conditions with rescue, ensure, if or unless by @Sija in #631

New Features

Enhancements

  • Versioned documentation by @Sija in #702, #704 ⚠️
  • Replace --fail-level CLI switch with --min-severity by @Sija in #761 ⚠️
  • Silently ignore unknown config attributes, instead of failing by @Sija in #840 ⚠️
  • Sort sources and issues before passing them to the formatter by @Sija in #528, #576
  • Sort TODO issues by rule name by @straight-shoota in #610
  • Remove noise from --gen-config by @straight-shoota in #616
  • Make issue messages moar Markdown-friendly by @Sija in #529
  • Improve markdown text styles rendering in CLI by @Sija in #700
  • Add Git SHA to the printed version by @Sija in #641, #643
  • Add autocorrect to more rules by @veelenga in #796
  • Add ability to ignore :nodoc: methods in Typing rules by @Sija in #557
  • Add --ignore-config CLI flag by @Sija in #841, #845
  • Make Presenter::RulePresenter output the rule documentation url by @Sija in #868, #869

Bug Fixes

  • Implement project root directory detection by @Sija in #588 ⚠️
  • Raise on invalid file path by @veelenga & @Sija in #827 ⚠️
  • Ignore blank values in CLI flags by @Sija in #757 ⚠️
  • Fix Formatter::DotFormatter failures count by @Sija in #530
  • Do not autocorrect disabled issues by @veelenga in #783
  • Fix specs to support Crystal 1.17 by @Sija in #628
  • Fix specs for Crystal 1.19.0 by @Sija in #749
  • Fix select expression omissions by @Sija in #629
  • Fix missing logic for block arguments by @Sija in #670
  • Fix Git SHA command for Windows by @SunP04 in #667
  • Windows related fixes by @Sija in #677
  • Fix CodeQL issues by @Sija in #707
  • Make sure to return Bool from #visit methods by @Sija in #715
  • Correctly reset location-less node scope in AST::ScopeVisitor by @Sija in #806
  • Fix --fail-level CLI switch not having any effect by @Sija in #759
  • Revert "Fix --fail-level CLI switch not having any effect" by @Sija in #760
  • Potential fix for 1 code quality finding by @nobodywasishere in #775
  • Fix edgecase in Formatter::Util#affected_code location marker display logic by @Sija in #813
  • Always preserve excluded files in config by @Sija in #841
  • Fix typos in docs by @Sija in #863
  • Fix language mistakes by @Sija in #874
  • Fix AST::Util#loop? method by @Sija in #888

Refactors

Infrastructure

  • Drop support for Crystal < 1.17 by @Sija in #678 ⚠️
  • Drop support for Crystal < 1.19 by @Sija in #802 ⚠️
  • Skip auto compilation (drops postinstall script) by @Sija in #741 ⚠️
  • Don’t install bin/ameba.cr executable by @Sija in #807 ⚠️
  • Add .vscode and .zed folders to .gitignore by @nobodywasishere in #564
  • Restructure Ameba Distribution by @Sija in #470
  • Windows compatibility by @Sija in #668
  • Add Windows CI support by @Sija in #673
  • Add “Update JSON Schema” CI workflow by @Sija in #686
  • Run “Update JSON Schema” CI workflow via GitHub App by @Sija in #688
  • CI workflow tweaks by @Sija in #693
  • Tweak CI workflows by @Sija in #705
  • Build Docker image with the --release flag by @Sija in #730, #731
  • Do not use quotes for CRFLAGS build argument by @Sija in #732
  • Add _typos.toml configuration file by @Sija in #681
  • Rename _typos.toml to .typos.toml by @Sija in #764
  • Add “Spell checker” CI workflow by @Sija in #742
  • Add release workflow to build/upload on release tags by @ysbaddaden in #789
  • Test minimal supported Crystal version in CI by @Sija in #822
  • Support Crystal v1.21 by @Sija in #823, #866
  • Enable the Style/CallParentheses rule in Ameba repo by @Sija in #844
  • Tweak CI release workflow by @Sija in #848
  • Add git commit to the Ameba version in the Docker image by @Sija in #852
  • Skip CI on automated JSON Schema updates by @Sija in #855
  • Sort doc version index upon addition by @Sija in #857
  • Raise a compile-time error on invalid build version by @Sija in #864
  • Point urls to the new crystal-ameba.org domain by @Sija in #876
  • Point documentation urls to the new /api path by @Sija in #877
  • Use the new /api path prefix in docs CI workflows by @Sija in #879
  • Add a contributing guide by @Sija in #878
  • Add SECURITY.md by @Sija in #880

Dependabot

New Contributors

Warning

Requires Crystal 1.19.0

Full Changelog: v1.6.4...v1.7.0