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

noNestedMacros #16

Closed
allanbowe opened this issue Apr 1, 2021 · 1 comment · Fixed by #22
Closed

noNestedMacros #16

allanbowe opened this issue Apr 1, 2021 · 1 comment · Fixed by #22
Labels

Comments

@allanbowe
Copy link
Member

allanbowe commented Apr 1, 2021

If a SAS macro is defined like so:

%macro outer();
  /* any amount of arbitrary code */
  %macro inner();
    %put inner;
  %mend;
  %inner()
  %put outer;
%mend;

%outer()

This is widely considered as bad practice, because the inner definition is recompiled every time the outer macro is invoked.

We should create a lint warning if a subsequent %macro is discovered before a %mend in a SAS program.

For reference, a more 'correct' way to have defined the above would have been:

%macro inner();
   %put inner;
%mend;
%macro outer();
  /* any amount of arbitrary code */
  %inner()
  %put outer;
%mend;

%outer()

Rule name: noNestedMacros

@allanbowe allanbowe changed the title No nested macros noNestedMacros Apr 5, 2021
@ghost
Copy link

ghost commented Apr 6, 2021

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant