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

fix codenarc P2/P3 violations #3667

Merged
merged 7 commits into from
Dec 15, 2024

Conversation

coutvv
Copy link
Contributor

@coutvv coutvv commented Dec 14, 2024

I had fixed here all P2 and P3 CodeNarc violations and enable zero tolerance to the new one.

Rules of CodeNarc:
https://codenarc.org/codenarc-rules-formatting.html
https://codenarc.org/codenarc-rules-convention.html


Also here I have disabled next CodeNarc rules:

  1. UnnecessaryReturnKeyword - because it conflict with other rule ImplicitReturnStatement.
  2. SpaceAroundMapEntryColon - resulted code looks so ugly, so I decided to disable this rule. Just look at it:
new File('.').traverse(
                type:FileType.FILES,
                preDir:{ file ->
                    if (file.name == 'target') {
                        return FileVisitResult.SKIP_SUBTREE
                    }
                },
                nameFilter:~/.*\.xsl/,
 )

If you think that I should prefer UnnecessaryReturnKeyword instead of ImplicitReturnStatement rule or if SpaceAroundMapEntryColon should be used - let me know.

@github-actions github-actions bot added the core label Dec 14, 2024
@coutvv coutvv changed the title #3643 fix codenarc violations fix codenarc P2/P3 violations Dec 14, 2024
@yegor256 yegor256 merged commit f7f638b into objectionary:master Dec 15, 2024
20 checks passed
@yegor256
Copy link
Member

@coutvv excellent contribution, many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants