-
Notifications
You must be signed in to change notification settings - Fork 2
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
linting feature request: no single star comments #95
Comments
Hey Carus! I've been thinking about this. Here are the initial test cases I came up with - can you think of any more? /**
* Examples of *message; format that SHOULD be caught
*/
/* 1. regular comment */
* some text;
/* 2. multiline comment */
*
multiline
text;
/* multiple asterisks - should start on first */
*---------------------------------------*
| This uses one comment statement |
| to draw a box. |
*---------------------------------------*;
/* 3. comment at end of statement */
libname x (work); * some text;
/* 4. comment in middle of statement */
run; *walk
; run;
/* 5. comment at start of statement */
*; run;
/* 6. comment within a comment */
* /* ignored also */ ;
/* 7. In a macro */
%macro x; * %mend;
/**
* Examples of *message; format that should NOT be caught
* (this was the first)
*/
/* 2. In a string literal */
data _null_;
string='no*no;no';
string="not*this;either";
run;
/* 3. In a %str() block */
%let x=%str(afraid *not; sir);
/* 4. In an nrstr() block */
%let y=%nrstr(try*again;please);
/* 5. In a %put statement */
%put not * today;;
/* 6. As a macro comment */
%* this one is totally normal;
/* 7. in a LUA proc */
proc lua;
submit;
-- hi *mum;
endsubmit;
run;
/* 8. in a data step */
data;
a * b;
b ** a;
run;
/* 9. sql / fedsql */
proc sql;
select * from sashelp.cars;
select /* */ * from sashelp.class;
select a.*, b.* from a,b;
/* 10. in a macro but wrapped in brackets */
%macro x;(*)%mend;%x; Link to docs: https://documentation.sas.com/doc/en/pgmsascdc/v_015/lestmtsglobal/n1v51exifva71an1cvfn2z6j26lo.htm?homeOnFail |
Oh wow thanks Allan, |
I'm wondering if we will need to build a tokenizer to make this work! |
@all-contributors add @Carus11 for ideas |
I've put up a pull request to add @Carus11! 🎉 |
Hello @Carus11 @allanbowe Thanks for the idea and your input. 🙌🏽 |
Could I request a rule to ensure there are none of those single star comments, basically
Fails, and:
Passes
The text was updated successfully, but these errors were encountered: