-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Blacken salt (Implements SEP 15) #55765
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
Conversation
|
This is pretty cool! There seem to be some config issues, or really black issues (PyCQA/pycodestyle#373), but things look pretty good! |
s0undt3ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the pre-commit config dotfile on Salt's repo, let's add something like:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
args: [--line-length, '120', .]Ajust args to those you used when blackening Salt.
|
Well, I'm sure there will be a few more merge conflicts, but this should be much further down the path. Also I fixed all the lint issues that I had, and added black to pre-commit 🎉 |
s0undt3ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, any files under salt/ext should be ignored by black. These are vendored modules which we should keep as intact as possible.
4f68b18 to
7c84877
Compare
|
is it worth holding off on this until the PR queue from other branches has been considered 'resolved' and handled? |
|
@mattp- I would say no. Rebasing and blackening the other PRs should avoid merge conflicts there. Also, I'm pretty sure that most or all the PRs that had tests have been merged. Meanwhile, we'll have any new development unable to take advantage of black. If there was a weeks worth of effort or even maybe a month I might feel otherwise, but there's still quite a lot of work to do in the master port effort. We're going to have to deal with merge conflicts and other issues anyway - at least if the code is blackened first we can avoid any code formatting issues there. |
4607548 to
75ff102
Compare
s0undt3ch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.pylintrc
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the comment says, these are basename regex patterns, not paths.
This won't do what you want.
noxfile.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to write to stderr even before trying to import nox.
We can wrap this code block with fmt: on/off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this back up?
pkg/rpm/build.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This salt.version import should probably go back to where it was, see the sys.path.append before it?
salt/_logging/impl.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports need to go back to where they were. See the comment above where we define the new log levels.
E203 is *not* pep8 compliant, pylint.
|
Restarted CentOS 8, if that build passes, let's merge. |
|
@s0undt3ch https://jenkinsci.saltstack.com/job/pr-centos8-py3/job/PR-55765/15/ \o/ Codecov is complaining, and uh... I think I broke it 🙃 Tried to go to codecov to dismiss that change. but it was very unhappy 😝 |
|
Ignore codecov |
|
🎆 |
|
🖤 |
What does this PR do?
What it says on the tin. Implements SEP 15 - at least the
blackportion of it. Apparentlyisortwill cause a bunch of issues with our linting, because of the number of lint comments around imports.What issues does this PR fix or reference?
SEP 15
Previous Behavior
Salt's code was painted many different colors of bikeshed
New Behavior
Salt's code is now a lovely shade of Black
Tests written?
No (code should not have been changed)
Commits signed with GPG?
Yes