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

make linter use lineinfo to check originating package #24270

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Oct 10, 2024

fixes #24269, refs #20095

Instead of checking the package of the used sym to determine whether a stylecheck should trigger, we check the package of the lineinfo instead. Before #20095 this checked for the current compilation context module instead which caused issues with generic procs, but the lineinfo should more closely match the AST.

I figured this might cause issues with includes etc but the foreign package test specifically tests for an include and passes, so maybe the package determining logic accounts for this already. This still might not be the correct logic, I'm not too familiar with the package handling in the compiler.

Package PRs, both merged:

@Araq Araq merged commit aaf6c40 into nim-lang:devel Oct 11, 2024
19 checks passed
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from aaf6c40

Hint: mm: orc; opt: speed; options: -d:release
175102 lines; 8.213s; 655.215MiB peakmem

narimiran pushed a commit that referenced this pull request Oct 11, 2024
fixes #24269, refs #20095

Instead of checking the package of the *used sym* to determine whether a
stylecheck should trigger, we check the package of the lineinfo instead.
Before #20095 this checked for the current compilation context module
instead which caused issues with generic procs, but the lineinfo should
more closely match the AST.

I figured this might cause issues with includes etc but the foreign
package test specifically tests for an include and passes, so maybe the
package determining logic accounts for this already. This still might
not be the correct logic, I'm not too familiar with the package handling
in the compiler.

Package PRs, both merged:

- json_rpc: status-im/nim-json-rpc#226
- json_serialization:
status-im/nim-json-serialization#99

(cherry picked from commit aaf6c40)
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.

regression from v1.6.12: --styleCheck:error stops checking style for openArray
2 participants