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

Change naming linting for extern symbols #26598

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Jan 24, 2025

Fixes how we lint extern symbols in chplcheck for name violations.

Extern symbols should not be linted for name violations, because they typically come from another language that has different naming conventions. Furthermore, the user may have no control over the type name (i.e. using a third-party library). chplcheck already handled this correctly for functions and variables/types, but not for records. This PR rectifies that.

This PR also adds an opt-out, if the user has renamed their symbol, then they do have full control of the name and this PR turns on linting in that case. In the following program, we should lint the name chapelFunc, because that's a name picked by the user and not relevant to the external name.

proc "extern_c_func" proc chapelFunc() { }
  • start_test test/chplcheck

[Reviewed by @brandon-neth]

Copy link
Contributor

@brandon-neth brandon-neth left a comment

Choose a reason for hiding this comment

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

Neat! LGTM

@jabraham17 jabraham17 merged commit 8b18bec into chapel-lang:main Jan 27, 2025
9 checks passed
@jabraham17 jabraham17 deleted the fix-extern-rule branch January 27, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants