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

Provide a warning when detecting the use of an undeclared macro. #145

Open
tmoody opened this issue Jan 11, 2022 · 1 comment
Open

Provide a warning when detecting the use of an undeclared macro. #145

tmoody opened this issue Jan 11, 2022 · 1 comment

Comments

@tmoody
Copy link
Member

tmoody commented Jan 11, 2022

Please can the linter report if an undeclared macro had been used?

Declared macros are considered to be:

  • built-in SAS macros such as %scan, %index, %trim, etc
  • macros that are already named under the <h4> SAS Macros </h4> section of a job's header
  • declared within the job itself (including via <h4> SAS Includes </h4>)

SAS Macro keywords (such as %if,%then, and %do) should not trigger the rule.

It is accepted that macros made available to a job through the SASAUTOS system option will trigger false positives.

@allanbowe
Copy link
Member

Similar to #212 this is not something that would always "work" given that the linter can only assess the file in question (or surrounding files in the filesystem)

There are many cases where the macro definition could be defined outside the file in question eg, the autoexec, stpinit reference, secondary SASjs Artefacts, the SASAUTOs false positives you already mentioned.

A reasonable workaround would be that we could include an 'ignore list' on a per file, or per project basis.

On that basis, if there is funding, we would build it.

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

No branches or pull requests

2 participants