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

sqf: Add lint for vars that are ALL_CAPS and not a macro #793

Merged
merged 8 commits into from
Oct 15, 2024
Merged

Conversation

PabstMirror
Copy link
Collaborator

Checks for global variables that are ALL_CAPS and may actually be a undefined macro

ref acemod/ACE3#10389
I think default off is a best as some mods use all caps in their code style
e.g. CBA/ACRE SLX_XEH_MACHINE ACRE_SPOKEN_LANGUAGES ACRE_IS_SPECTATOR

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 77.24138% with 33 lines in your changes missing coverage. Please review.

Project coverage is 68.0%. Comparing base (1649e3a) to head (f6c03b4).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
libs/sqf/src/analyze/lints/s17_var_all_caps.rs 75.5% 33 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
libs/preprocessor/src/processor/directives.rs 91.1% <100.0%> (+<0.1%) ⬆️
libs/preprocessor/src/processor/mod.rs 89.2% <100.0%> (-0.1%) ⬇️
libs/workspace/src/reporting/processed.rs 90.7% <100.0%> (+1.4%) ⬆️
libs/sqf/src/analyze/lints/s17_var_all_caps.rs 75.5% <75.5%> (ø)

@BrettMayson
Copy link
Owner

BrettMayson commented Oct 10, 2024

Default on, but mods can exclude patterns?

Just with ACRE_*,ACE_*, etc .

@PabstMirror PabstMirror marked this pull request as ready for review October 11, 2024 16:15
Copy link
Owner

@BrettMayson BrettMayson left a comment

Choose a reason for hiding this comment

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

Added a did you mean and context to the diagnostic

image

@BrettMayson
Copy link
Owner

Add label on the source when it is a macro

image

@BrettMayson BrettMayson merged commit c823e30 into main Oct 15, 2024
33 checks passed
@BrettMayson BrettMayson deleted the all_caps branch October 15, 2024 08:05
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