Fix LocalsWithoutParens task#104
Conversation
|
Warning Rate limit exceeded@NickNeck has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request involves modifications to three files: In The Correspondingly, the test file Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
lib/recode/task/locals_without_parens.ex (1)
122-123: Consider a more robust method to detect parenthesesRelying on
Keyword.has_key?(meta, :closing)assumes that the presence of the:closingkey accurately indicates parentheses. Changes in the parser or formatter could affect this metadata. Consider using a more reliable approach to determine if parentheses are present, such as analyzing the syntactical structure directly..credo.exs (1)
163-164: Review the decision to disable specific Credo checksDisabling
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []}and{Credo.Check.Refactor.FunctionArity, []}means these checks will not run. Consider whether these checks are unnecessary for your codebase or if they could provide valuable insights into potential improvements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
mix.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.credo.exs(2 hunks)lib/recode/task/locals_without_parens.ex(4 hunks)test/recode/task/locals_without_parens_test.exs(3 hunks)
🔇 Additional comments (7)
lib/recode/task/locals_without_parens.ex (2)
26-27: Good use of module attributes for clarityDefining
@defand@excludeas module attributes enhances code readability and maintainability by clearly specifying the lists of forms to be used in pattern matching.
70-71: Verify the use ofZipper.next(zipper)to avoid skipping nodesIn the clause handling function definitions, using
Zipper.next(zipper)advances the zipper, potentially skipping nodes that may need processing. Ensure this is intentional and that no necessary nodes are being overlooked.test/recode/task/locals_without_parens_test.exs (4)
34-61: Excellent addition of test cases for function definitionsThe new test
"does not remove parens in def*"effectively ensures that parentheses are not removed from function definitions, coveringdef,defp,defmacro, anddefmacrop. This enhances the reliability of theLocalsWithoutParenstask.
Line range hint
83-92: Corrected test name enhances clarityRenaming the test from
"adds no issue for dev"to"adds no issue for def"accurately reflects the purpose of the test, improving code readability and understanding.
93-101: Added tests ensure correct handling ofdo:syntaxThe test
"add no issue for parens in do:"confirms that parentheses are appropriately handled when using thedo:syntax in function definitions. This addition strengthens test coverage for this specific case.
103-113: Tests for tuples and maps improve robustnessThe test
"add no issue for parens in tuples and maps"verifies that parentheses in tuples and maps are handled correctly, ensuring that no unnecessary issues are reported. This contributes to more comprehensive test coverage..credo.exs (1)
49-49: Enablingstrict: trueincreases code scrutinySetting
strict: truewill enforce stricter linting rules and may result in more warnings and errors. Ensure that the team is prepared to address these additional reports and that this aligns with the project's code quality goals.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
mix.exs (1)
Line range hint
114-118: Document the version-based dependency exclusion.The implementation of the version check is correct. However, please add a comment explaining why
freedom_formatteris excluded for Elixir 1.18+. This will help future maintainers understand the rationale behind this version-specific dependency management.+ # freedom_formatter is not needed for Elixir 1.18+ because ... if Version.match?(System.version(), "~> 1.18") do
Pull Request Test Coverage Report for Build 231569e75d9015446143218c1a61318761b611b4Details
💛 - Coveralls |
* Bump version * Changes for rewrite 1.0.0 (#96) * Update rewrite * Read inputs from .formatter.exs (#98) * Add recode.issues manifest (#99) * Add comments * Remove trailing whitespace * Move example backup script to mix task * Update the readme for the my_code example * Update docs * Format mix.exs * Fix false positive in LocalWithoutParens * Update wording in CliFormatter * Add example minimal A minimal example to test recode. * Update manifest handling * Update changelog * Update .dialyzer_ignore.exs * Add tests for manifest * Add tests for manifest * Add specs and docs * Update test * Create issues for unformatted files in dry mode This feature is already part of recode, but was lost in the development of the new version. * Add minor refactorings * Add silent mode (#100) * Add silent mode * Remove negated condition in if-else * Add default for silent in CliFormatter * Update silent mode doc * Add some tests * Fix typo * Add tests * Fix rebase fail * Add minor refactorings * Update tests * Update tests * Fix LocalsWithoutParens task (#104) * Update changelog * Fix LocalsWtihoutParens for multiline calls * Fix LocalsWtihoutParens in pipes * Run mix format * Update test * Fix typos * Update deps * Update deps and rebase main * Check dot_formatter * Make dialyzer happy * Fix check_dot_formatter * Fix check_dot_formatter * Fix task AliasOrder * Update changelog
Summary by CodeRabbit
Linting Configuration
Code Formatting
Testing