-
Notifications
You must be signed in to change notification settings - Fork 54
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
Black formatting of existing code and inclusion of formatting check in workflow #78
Conversation
Bringing in current `dev` branch to `main` with new CI and bugfix
conda-requirements.txt
Outdated
iris | ||
cf-units | ||
xarray | ||
cf - units |
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.
Is this the autoformatting making these changes? Might have to restrict it from these files (i.e. non-python files) as I think this would break them
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.
You are right, I fixed this!
I think we should merge this into |
Just changed the base to dev, thought that that might run the docker checks but it doesn't seem to |
My guess is that the issue is that |
get changed docker image file
Great, seems to work now @freemansw1 ! |
Now that it's passing the CI checks, I'm happy for this to be merged, but I'll let @w-k-jones as it's his review. |
Hi, I was just about to merge the PR, but then did the black reformatting by myself to be really on the safe side. Interestingly, I don't get exactly the same results. In my case, some more spaces have been added, e.g. > git diff fabians-PRcheck..juliasPR
...
def calculate_cog_untracked(mass, mask):
- """ caluclate centre of gravity and mass for untracked parts of domain
+ """caluclate centre of gravity and mass for untracked parts of domain
Input:
- mass: iris.cube.Cube
+ mass: iris.cube.Cube
... Any idea what happend? |
And yes, I was running > for py in `find -iname '*.py'`; do echo $py; black $py;done using > conda list black
# packages in environment at /home/senf/.miniconda3:
#
# Name Version Build Channel
black 19.10b0 py37_0 conda-forge on my linux OS |
@sean , @w-k-jones & @JuliaKukulies : If you don't think that these super-small differences matter, please press the merge button and step forward! |
Hmm..that is interesting. I used black 22.1.0. I tried to see if the same thing happens, when I use the same version as you:
but all files remain unchanged. These are really small differences, but on the other hand the idea with black is to have everything exactly consistent. If you go down the rabbit hole of formatting (section "empty lines"), I think it is against PEP-8 to have empty lines directly after the function definition, since you already have an indentation. Do you pass the formatting check when you push your changes? |
Not sure why your black formatting has included the extra spaces, however I believe that the PR is formatting correctly (without spaces) so I'm happy to merge if there are no other exceptions |
OK, as a last check: My |
No description provided.