Skip to content

Fix violations found by running JuliaCheck on itself#114

Merged
reniers-tiobe merged 12 commits intomainfrom
juliacheck-self
Jan 28, 2026
Merged

Fix violations found by running JuliaCheck on itself#114
reniers-tiobe merged 12 commits intomainfrom
juliacheck-self

Conversation

@reniers-tiobe
Copy link
Contributor

@reniers-tiobe reniers-tiobe commented Jan 23, 2026

In particular, solved violations for:

  • underscore-prefix-for-private-functions. For the methods on Check subtypes, we solved it my making them explicitly extend the methods in Analysis.
  • multiline-comments-for-many-lines
  • module-end-comment
  • use-isnothing-to-check-for-nothing-values

Note that JuliaCheck already runs on itself as part of the tests. The results are found in file test/JuliaCheck-self.out.

In particular, solved violations for:
- `underscore-prefix-for-private-functions`. For the methods on Check subtypes, we solved it my making them explicitly extend the methods in Analysis.
- `multiline-comments-for-many-lines`
- `module-end-comment`
…atement`

There are two remaining violations that I believe are false positives. Going to fix the rule in another PR.
@reniers-tiobe reniers-tiobe changed the title Fix some violations found by running JuliaCheck on itself Fix violations found by running JuliaCheck on itself Jan 23, 2026
@reniers-tiobe
Copy link
Contributor Author

Submitted RM-37764 for fixing FP on long-form-functions-have-a-terminating-return-statement

@reniers-tiobe
Copy link
Contributor Author

reniers-tiobe commented Jan 26, 2026

Submitted RM-37771 for false positive found.

I propose not to await this and merge this PR back.

@brouwers-tiobe brouwers-tiobe self-requested a review January 26, 2026 16:27
Copy link
Contributor

@brouwers-tiobe brouwers-tiobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through the changes and did not find anything strange, and tests pass for me locally as well.

Beside that, I ran JuliaCheck on files under ./src and ./checks directories using:

find ./checks/ ./src -iname *.jl | xargs julia --project src/JuliaCheck.jl --output json --outputfile ./selfcheck_out.json --

Most violations for the mentioned rules are indeed gone. The only exception is underscore-prefix-for-private-functions, for which one violation remains in ./checks/PreferConstVariablesOverNonConstGlobalVariables.jl and several in the ViolationPrinter implementations (on the Output implementation methods). The latter are similar to the Check methods extending Analysis, I believe.

The printers directory is not covered by the self check in runtests.jl, so I guess these were not caught. Not sure if we still want to address those; regardless a lot was fixed -> LGTM

@reniers-tiobe reniers-tiobe merged commit 3ec7800 into main Jan 28, 2026
2 checks passed
@reniers-tiobe reniers-tiobe deleted the juliacheck-self branch January 28, 2026 11:34
@reniers-tiobe
Copy link
Contributor Author

Note that there are still violations left, but we will leave them for later. Some are believed to be false positives and tickets have been created for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants