GithubHelp home page GithubHelp logo

PEP8 style change about hardware HOT 6 CLOSED

redhat-cip avatar redhat-cip commented on August 28, 2024
PEP8 style change

from hardware.

Comments (6)

tbreeds avatar tbreeds commented on August 28, 2024

I'm okay with doing this but I'd like us to have a very good look at which other PEP8 style things we want to do and just do series of conversions that are only pep8 related and the most obvious changes only.

It will of course force and and all open PR to conflict so we need to be mindful of that

from hardware.

elfosardo avatar elfosardo commented on August 28, 2024

@tbreeds thanks for your answer, what I had in mind with this was just a start towards better defined pep8 rules.
When opening a PR, I usually try to stick to the 80 characters rule and change the module I'm working on, but I agree we should just have pep8 related changes to not mix with code change.
Ideally, after defining a set of style rules we'd like to have I'd go module by module one at a time and apply them.
My starting proposal for the pep8 rules:

  • Remove the 160 characters limit and have a standard 80 characters instead.
  • Keep ignoring E123 and E125, but remove H803 and H302 from the ignore list.
  • Add to enable-extensions:
    [H106] Don't put vim configuration in source files.
    [H203] Use assertIs(Not)None to check for None.
    [H204] Use assert(Not)Equal to check for equality.
    [H205] Use assert(Greater|Less)(Equal) for comparison.

It's a lot of change to have all at the same time, so we could also apply only 1 or 2 rules at a time.

from hardware.

tbreeds avatar tbreeds commented on August 28, 2024

My starting proposal for the pep8 rules:

  • Remove the 160 characters limit and have a standard 80 characters instead.
  • Keep ignoring E123 and E125, but remove H803 and H302 from the ignore list.

I'd actually (I think) like to see E123 and E125 removed from the ignore list
H803 is trivial to get rid of. I think removing H302 would depend on what the pacth looked like. Personally I'm okay with importing parts of modules esp when the code is clean but I could easily be convinced.

  • Add to enable-extensions:
    [H106] Don't put vim configuration in source files.
    [H203] Use assertIs(Not)None to check for None.
    [H204] Use assert(Not)Equal to check for equality.
    [H205] Use assert(Greater|Less)(Equal) for comparison.

Sure they all look fine to me.

It's a lot of change to have all at the same time, so we could also apply only 1 or 2 rules at a time.

Yup. I guess step one is upgrade to a 'new' version of hacking, step two is the line length an then it's just one rule at a time. It's a lot of churn but if you have time to do it I'll make time to review it

from hardware.

elfosardo avatar elfosardo commented on August 28, 2024

I did a quick test and removing E123,E125,H803 didn't actually change anything, although I think E123 and E125 are actually invalid pep8, so I still suggest to leave them.

We can also leave H302 for the time being.

There is also some refactoring to do on the docstrings in all the modules, but we'll get there.

from hardware.

elfosardo avatar elfosardo commented on August 28, 2024

First simple patch #99

from hardware.

elfosardo avatar elfosardo commented on August 28, 2024

Considering the latest changes, I think this can be closed.
Feel free to re-open it if you feel there's more to discuss.

from hardware.

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.