Skip to content
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

Refactors before 1.7 release #555

Merged
merged 29 commits into from
Jan 30, 2025
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
da33d70
`eq true` -> `be_true`
Sija Dec 29, 2024
6af9e1c
Cleanup redundant `:nodoc:` annotations
Sija Dec 29, 2024
6a70b09
Fix code indentation in specs
Sija Dec 29, 2024
ca5b806
Correctly wrap typo suggestions in backticks
Sija Dec 29, 2024
360f7d7
Change `Documentation` rule group severity to `Convention` instead of…
Sija Dec 29, 2024
7c38b88
Change `Documentation/DocumentationAdmonition` rule severity to `Warn…
Sija Dec 29, 2024
954493f
Add missing `describe` blocks
Sija Dec 29, 2024
68c3852
Keep `subject` assignments within the `describe` block
Sija Dec 29, 2024
565988e
Refactor formatters’ specs
Sija Dec 29, 2024
34966ed
Make some internal methods private
Sija Jan 8, 2025
b3884e9
Remove `prefer_name_location: true` since it doesn’t change anything
Sija Jan 12, 2025
0be073f
Remove some `ameba:disable Lint/NotNil` directives
Sija Jan 12, 2025
fb87aa3
Return early in `Lint/Formatting` if source code is empty
Sija Jan 12, 2025
78c0f76
Cleanup `AST::Reference` spec
Sija Jan 12, 2025
9d0d564
Add `Rule::Lint::Typos#fail_on_missing_bin?` option
Sija Jan 12, 2025
69f9f8c
`eq nil` -> `be_nil`
Sija Jan 12, 2025
eaeebd9
Move `ecr_supported?` macro to the top of the module
Sija Jan 15, 2025
fb80d37
Add `Source#ecr?` method
Sija Jan 16, 2025
71cc07f
Use `path` getter instead
Sija Jan 16, 2025
2f07b29
Make some methods private
Sija Jan 28, 2025
fe8fba5
Add additional spec assertion
Sija Jan 29, 2025
170fbf6
Wrap long lines for better readability
Sija Jan 29, 2025
131c35e
Refactor visitors a bit
Sija Jan 29, 2025
6ef291d
Use `Enabled: true` in the rules’ YAML configuration example sections
Sija Jan 29, 2025
a961126
Several readability related refactors
Sija Jan 29, 2025
2e8c287
Add backticks around Crystal keywords in some more comments and messages
Sija Jan 29, 2025
074d86e
Move `describe` block outside of `Ameba.ecr_supported?` call
Sija Jan 29, 2025
6b19c0f
Tweak rules’ docs and messages
Sija Jan 29, 2025
cd144e9
Use variant of heredoc without interpolation wherever possible
Sija Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move ecr_supported? macro to the top of the module
  • Loading branch information
Sija committed Jan 30, 2025

Verified

This commit was signed with the committer’s verified signature.
reneme René Meusel
commit eaeebd9d0c5053bf318269c5cc941ee1d3a2a375
12 changes: 6 additions & 6 deletions src/ameba.cr
Original file line number Diff line number Diff line change
@@ -20,6 +20,12 @@ module Ameba

VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}

macro ecr_supported?(&)
{% if compare_versions(Crystal::VERSION, "1.15.0") >= 0 %}
{{ yield }}
{% end %}
end

# Initializes `Ameba::Runner` and runs it.
# Can be configured via `config` parameter.
#
@@ -32,12 +38,6 @@ module Ameba
def run(config = Config.load)
Runner.new(config).run
end

macro ecr_supported?(&)
{% if compare_versions(Crystal::VERSION, "1.15.0") >= 0 %}
{{ yield }}
{% end %}
end
end

require "./ameba/*"