-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Suggestion: remove warnings/errors for detected parse errors (PHPCS 4) #2455
Milestone
Comments
12 tasks
Good idea |
gsherwood
added a commit
that referenced
this issue
Jan 31, 2020
I think they're all gone now. |
Great news! |
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most sniffs will just bow out during live coding/when they encounter parse errors.
There are however a number of sniffs which will either throw an
exception
or a CSwarning
/error
when a parse error is encountered.In my opinion, a linter should be used to check for parse errors, preferably before running PHPCS over code as the results of PHPCS will be unreliable anyway when code contains parse errors (we can't account for every situation).
For those people who are uncomfortable running a linter themselves, PHPCS offers the
Generic.PHP.Syntax
sniff which will run the linter for them.With all that in mind, I would like to suggest removing all parse error related warnings/errors/exceptions from sniff code within PHPCS (not from the
Tokenizer
classes!) in PHPCS 4.0.0 in favour of just silently bowing out.The text was updated successfully, but these errors were encountered: