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

Extra invalid syntax detection #984

Open
cverbiest opened this issue Aug 5, 2022 · 2 comments
Open

Extra invalid syntax detection #984

cverbiest opened this issue Aug 5, 2022 · 2 comments

Comments

@cverbiest
Copy link

I've come across following in our code.
This is wrong because of the double && on &not_avail_string

{ cceinc/trigdsp.i &ident      = BOEKJAAR-MISC
            &rec_field  = BJ-EINDE
            &dsp_frame  = {&misc_frame}
            &dsp_field  = WZ-TOT-DAT
            &&not_avail_string=ltodaystring }

This is easily overlooked and goes undetected because in this case it is an optional parameter.

Is the double & something that could be detected by a rule ?

I cannot imagine a situation where this would be valid, but maybe my imagination is limited.

@gquerret
Copy link
Contributor

gquerret commented Aug 6, 2022

It can be detected, but that will trigger false positives on some codebase (I'm sure there is at least one app on Earth that considers that having named parameters starting with & is a good idea). Could be part of a new optional rule.

@gquerret
Copy link
Contributor

gquerret commented Aug 6, 2022

Is the double & something that could be detected by a rule ?

The InvalidNamedParameter rule does this kind of check on named include parameters.

@gquerret gquerret changed the title Enhancement request: Extra invalid syntax detection Extra invalid syntax detection Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants