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

[LINT] Add rule explicit-begin #1336

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

suzizecat
Copy link

@suzizecat suzizecat commented May 16, 2022

Add rule to check if the begin keyword always follows a if/else/for.
Related to #1321

Julien FAUCHER added 3 commits May 16, 2022 15:42
@suzizecat suzizecat changed the title [LINT][WIP] Add rule explicit-begin [LINT] Add rule explicit-begin May 16, 2022
@suzizecat
Copy link
Author

This should be OK (clang-format was ran and tests were performed on a testcase).
I have not run the integrated tests because I didn't found a way to only run my test (I'm a noob with bazel).

@hzeller
Copy link
Collaborator

hzeller commented May 24, 2022

You can run your test with

bazel test //verilog/analysis/checkers:explicit_begin_rule_test

Julien FAUCHER added 2 commits May 31, 2022 16:07
Remove the fix suggestion as invalid
also move the error anchor to offending if/else/for in order to
allow test to pass
@suzizecat
Copy link
Author

Thanks, I understood the "reject" pattern thing.
This should be ok. however I need to add tests for "for" constructions

@hzeller
Copy link
Collaborator

hzeller commented Apr 24, 2023

What is the status of this PR @suzizecat ? Looks like we were almost there, just needed to make all the tests work.
Can you re-base and make the tests work, so that we're ready for review ?

@suzizecat
Copy link
Author

Hi @hzeller , I don't have access to the computer used for developing this before next week, but I'll have a look again at this time.
IIRC I have some issues with cases I hadn't accounted for at first glance.

I'll let you know if I run in any issues.

@sconwayaus
Copy link
Contributor

Hi @suzizecat. I was interested in this feature as a user and came across this PR. Are you wanting to finish this one off? Otherwise I'm happy to pick this up.

FWIW: I copied your code into a branch here: https://github.com/sconwayaus/verible/tree/begin_end_rule. Wasn't a lot of work to make this build at the head, (couple of BUILD files was about it), and I added some for loop tests too.

sconwayaus added a commit to sconwayaus/verible that referenced this pull request Apr 6, 2024
Copied the code from suzizecat@0b087d7
and rebased it to the head. Updated the tests and formatted.
@suzizecat
Copy link
Author

Hi @sconwayaus, I had issues with building (probably the BUILD files you fixed) but had no time to work on this.
If I remember correctly, there was also quite a few edge cases that weren't taken into account by this PR, but if you are willing to pick this up, please feel free to do so.

sconwayaus pushed a commit to sconwayaus/verible that referenced this pull request Apr 25, 2024
sconwayaus pushed a commit to sconwayaus/verible that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants