RedHatProductSecurity / cvss

CVSS2/3/4 library with interactive calculator for Python 2 and Python 3
GNU Lesser General Public License v3.0
79 stars 28 forks source link

Formatting and linting #41

Closed mprpic closed 1 year ago

mprpic commented 1 year ago

This formats the entire code base with Black and sorts imports with isort, which makes code contributions more consistent and removes the mental load of hand-editing code (or sorting statements) to fit a certain style.

Flake8 is also added to catch some common mistakes (one that was fixed here was regex strings that were not marked as raw r"".) If it gets too spammy, exclusions can always be added.

mprpic commented 1 year ago

I am not a fan of Black. I do not agree with some of the ways it formats code and sometimes I have a hard time reading it.

I get that it's not a perfect fit, but it beats having to think about formatting, and helps with consistency across all of our tools/services (we already use Black in every other project).

skontar commented 1 year ago

I am not standing in a way of you merging it, but I do not agree. It is a matter of preference and I prefer to not use it in our projects. Feel free to merge it, but do not expect me to pretend that I believe is useful or makes code more readable.