-
Notifications
You must be signed in to change notification settings - Fork 57
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
linter: new rule for declare(strict_types) #1228
base: master
Are you sure you want to change the base?
Conversation
Hidanio
commented
Jul 25, 2024
•
edited
Loading
edited
- added new linter rule: declareStrictTypes can not be "0"
- added quickFix for declareStrictTypes
- added new linter rule: lack of declare(strict_types=1) section
- added quickFix for lack of declare(strict_types=1) section
added quickFix for declareStrictTypes added test
…) section new rules for .gitignore new tests refactored warnings
64b7ffb
to
f83f419
Compare
strictMixed bool | ||
strictTypes bool | ||
strictMixed bool | ||
declareSection bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to do it differently. We have an ir.Root
node that describes the entire file. Essentially, we can check if there is an ir.DeclareStmt
at its level, and if there is, show an error.
see block.go
@@ -25,6 +25,24 @@ func addBuiltinCheckers(reg *CheckersRegistry) { | |||
After: `$s = strip_tags($s, '<br>')`, | |||
}, | |||
|
|||
{ | |||
Name: "notStrictTypes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split the checks into two different MRs, shall we?