-
Notifications
You must be signed in to change notification settings - Fork 212
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
Rule/explicit begin #2247
Rule/explicit begin #2247
Conversation
Copied the code from suzizecat@0b087d7 and rebased it to the head. Updated the tests and formatted.
…d blocks for each supported statement.
Add rule to check if the begin keyword always follows a if/else/for. Related to chipsalliance#1321
Remove the fix suggestion as invalid
also move the error anchor to offending if/else/for in order to allow test to pass
Merge branch 'rule/explicit-begin' of https://github.com/sconwayaus/verible into rule/explicit-begin
Merge branch 'rule/explicit-begin' of https://github.com/sconwayaus/verible into rule/explicit-begin
…erible into rule/explicit-begin
…aces instead of begin-end. To keep things simple, this change ignores all statements inside a constraint.
aefa9e2
to
33d5ed0
Compare
33d5ed0
to
6da2fe5
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2247 +/- ##
==========================================
+ Coverage 92.91% 92.95% +0.04%
==========================================
Files 359 360 +1
Lines 26758 27039 +281
==========================================
+ Hits 24863 25135 +272
- Misses 1895 1904 +9 ☔ View full report in Codecov by Sentry. |
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.
Very cool!
I need to look at it more in detail later this week.
Adding @fangism as he always enjoys looking at new rules. |
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.
Thanks, this is really cool!
Looks like the automatic generation of the rule documentation picked this up https://chipsalliance.github.io/verible/lint.html#explicit-begin |
This PR forks the initial work started in PR #1336 and extends the rule to check for begin-end blocks for all if, else, always, always_comb, always_latch, always_ff, for, forever, foreach, while and initial statements.
The rule is configurable allowing users to enable/disable this rule for each statement to provide some level of flexibility.
Aside from the usual unit testing, I've also spent the last 3 months using this rule in anger and it seems to be working quite well.
Resolves #2040
Related to #1321, misses on the case statement suggestion.