Giter Club home page Giter Club logo

Comments (5)

jeremiah-c-leary avatar jeremiah-c-leary commented on June 2, 2024 1

Afternoon @JHertz5 ,

I had to change the match to an if statement in the get_rule_name function to support pre 3.10 python. Otherwise it looks really good.
It sure cleans up with the code by reducing the number of arguments passed to the base rule class.

There were almost a 1000 files changed, so I appreciate the effort you put in to make development easier. I will have to keep my eye open for any other similar improvements that can be made.

I will push this to master.

Thanks again,

--Jeremy

from vhdl-style-guide.

JHertz5 avatar JHertz5 commented on June 2, 2024

I have created a draft PR, #1118 to demonstrate the change. I will update the PR when I have time, likely this weekend, to remove the now-redundant identifier input to the Rule.__init__() method.

from vhdl-style-guide.

jeremiah-c-leary avatar jeremiah-c-leary commented on June 2, 2024

Morning @JHertz5 ,

I really like this idea. I can't count the number of times I have not updated either name or identifier, which is why there is always a test to check them. However, ensuring they are correct by using code is a much better solution.

For the name attribute, we could check for exceptions and replace. For example, the if rules are in the if_statement directory.

dir_name = get_current_directory_name()
if dir_name == 'if_statement':
    rule_name = 'if'
else:
    rule_name = dirname

That could be a stop gap until a real refactoring of rule names could take place.

Or maybe the directory names can change to match the rule name? For some reason I named the rule directory if_statement instead of if. I would like to think there was some conflict with python since if is a python keyword. but then again maybe not.

--Jeremy

from vhdl-style-guide.

JHertz5 avatar JHertz5 commented on June 2, 2024

Hi @jeremiah-c-leary.

Amazing, I'm glad that you like the suggestion! I'll be glad if I can make your life a tiny bit easier.

For the name attribute, we could check for exceptions and replace. For example, the if rules are in the if_statement directory.

That is a great idea. I'll include this in the PR, and renaming of rules or directories can come later. You might find it preferable to have infrastructure for exceptions; maybe there are cases where you'd like to have a more detailed directory name while keeping the rule name short, or as you say, there might be some conflict/confusion with Python keywords.

from vhdl-style-guide.

JHertz5 avatar JHertz5 commented on June 2, 2024

Hi @jeremiah-c-leary, thanks again for your advice. I have marked PR #1118 as "ready for review". There are a lot of files touched, which means that there is a high likelihood of causing conflicts on other branches, but they should be easy to resolve. Apart from the changes in vsg/rule.py and in the tests directory, the changes are just removing the name and identifier arguments from init functions everywhere.

from vhdl-style-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.