-
Notifications
You must be signed in to change notification settings - Fork 300
Paint it black #3502
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
Paint it black #3502
Conversation
202fcf0 to
6e354cd
Compare
d5cc8a2 to
2285d06
Compare
lib/iris/tests/unit/analysis/trajectory/test__nearest_neighbour_indices_ndcoords.py
Outdated
Show resolved
Hide resolved
lib/iris/tests/unit/fileformats/pp_load_rules/test__convert_time_coords.py
Show resolved
Hide resolved
lib/iris/tests/unit/fileformats/um/optimal_array_structuring/test_optimal_array_structure.py
Show resolved
Hide resolved
60cfb52 to
01d7483
Compare
01d7483 to
293e2e8
Compare
59ebf65 to
f0e2986
Compare
4f335c7 to
9fea7e1
Compare
9fea7e1 to
6c23a8a
Compare
| self.assertCoordsAndDimsListsMatch(coords_and_dims, expected) | ||
|
|
||
|
|
||
| class TestArrayInputWithLBTIM_0_3_1(TestField): | ||
| @unittest.skip("investigate failure") | ||
| def test_t1_scalar_t2_list(self): |
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.
See #3508 as a promise to follow-up and investigate this failing unit test.
Discovered it thanks to enabling flake8 across the whole code base 😉
|
@bjlittle I think it's important that we tick that final box regarding documentation before we make this change. I appreciate there's a planned bigger effort to improve the developer docs but it would be wrong to wait until then to mention Black, although that may be the time to write something more detailed. Thanks! |
|
Replaced by #3518 It's easier to base these changes on a later version of |
This PR enables black, the opinionated, uncompromising code formatter.
It's a good thing, and I've bought into the hype. Needless to say, so have many other leading scientific python packages, such as dask, xarray, and pandas. If you need more convincing,
... and it even has editor and IDE integration support 😀
This PR also incorporates support for pre-commit git hooks, which when enabled will allow the developer to ensure that all
iriscode in the repository isblackcompliant, by automatically executingblackwhenever a developergit commitcommand is performed. Note that, thepre-commithooks run only against the code changed/new to the PR, and not over the wholeirisrepository - so it's not an expensive act.In addition to enabling the
blackpre-commitgit hook, other hooks I've deemed useful have also been enabled. For a list of supported hooks, see here.Note that,
blackis also now part of thetravis-ciworkflow, to ensure that developers are actually committingblackcompliant code as part of their PR.Also, for the first time ever, this PR make the entire code base
flake8compliant (with# noqaexceptions).Still to do...
blackformatdocs.blackformattests.stickler-ciatblackv18.9b0 conflicts withv19.10b0.stickler-civersion is too old 😞flake8files toignoreforstickler-ci, to temporarily appease it.decide whether to disable.stickler-ciflake8pre-commit hook along withstickler-ciflake8👍flake8inpre-commit(temporary).flake8compliant..flake8files that we explicitlyexclude.flake8inpre-commit.iris.tests.test_coding_standards.TestCodeFormatandiris.tests.test_coding_standards.StandardReportWithExclusions.pp_load_rulesunit test.github/CONTRIBUTING.mdand/or developer notes to provide relevantpre-commitconfiguration details.blackbadgemaster