jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
189 stars 38 forks source link

Enhance code tags with ability to disable a rule on the next line #418

Closed jeremiah-c-leary closed 3 years ago

jeremiah-c-leary commented 4 years ago

Add the following to code_tags:

-- vsg-disable-next-line <rule>

This would disable a rule for the next line only. Multiple rules could be listed also.

This issue in in support of issue #401

qarlosalberto commented 4 years ago

I have checked how the others linters do it. They disable N rules in N comment lines. For example:

      // eslint-disable-next-line semi
      // eslint-disable-next-line radix
      let linter = new Linter.Linter(linter_name)

For the editor is easier in separate lines. Is it a problem for you? If it's a problem I can look for other solution.

jeremiah-c-leary commented 4 years ago

I think I can support that. I could just collect exceptions until I hit a line that is not an exception.

jeremiah-c-leary commented 4 years ago

Hey @qarlosalberto ,

I just pushed an update to the issue-401 branch. Could you update and let me know if this update works for you.

Thanks,

--Jeremy

qarlosalberto commented 4 years ago

It runs fine, but I have a problem. I'm having style errors in the disable comments. What do you think about disable the style checker in the disable comments?

disable

gif

jeremiah-c-leary commented 4 years ago

I think it wants the comment indented, which if you put in a comment to disable it then that comment would violate. This seems like a reasonable request.

BTW, are you familiar with configurations? https://vhdl-style-guide.readthedocs.io/en/latest/configuring.html

You can configure rules and/or disable them. They get passed as a JSON/YAML file. You can create a configuration and then apply it to all your files.

qarlosalberto commented 4 years ago

Yes! I have added in the extension the ability to use a configuration file. The configuration rules are a powerful feature.

jeremiah-c-leary commented 4 years ago

Hey @qarlosalberto ,

I just committed a fix for next line code tags being flagged for non alignment. Could you update and let me know if it works for you?

Thanks,

--jeremy

qarlosalberto commented 4 years ago

@jeremiah-c-leary sorry for the delay, due to the holidays I'm not programming much in my free time. Let me a time to test it :)

qarlosalberto commented 4 years ago

It works fine between architecture and the begin:

image

But not after:

image

qarlosalberto commented 4 years ago

Hi @jeremiah-c-leary do you plan to add the --all_phases --js arguments to a release?

jeremiah-c-leary commented 3 years ago

Hey @qarlosalberto ,

The answer is yes. I am working on re-writing the rules for my new parser. Only 30 more to go!!! Unfortunately the new method broke the code tags, so I need to rethink how to implement it. It shouldn't be hard though.

So once I finish re-writing the rules and hardening the new parser, hopefully by mid November I will incorporate the changes we discussed into the master branch.

Regards,

--Jeremy

qarlosalberto commented 3 years ago

Thank you! :)

jeremiah-c-leary commented 3 years ago

@qarlosalberto , I just migrated this feature into master.

Could you pull down the latest master and let me know if it is working for you.

Thanks,

--Jeremy

jeremiah-c-leary commented 3 years ago

Hey @qarlosalberto ,

I am going to close this issue for release 3.0.0 similar to the other issue I just closed. If there are any updates regarding this we can open a new issue.

--Jeremy