Skip to content
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

[pre-commit.ci] autoupdate #83

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Nov 6, 2023

@peterjc
Copy link
Owner

peterjc commented Nov 6, 2023

Looks like Python 3.7 is OK, but otherwise:

Checking our configuration option appears in help
  --black-config TOML_FILENAME
Checking we report an error when can't find specified config file
ValueError: Plugin flake8-black could not find specified black config file: --black-config does_not_exist.toml
Checking failure with mal-formed TOML file
ValueError: Plugin flake8-black could not parse specified black config file: --black-config with_bad_toml/pyproject.toml
Checking we report no errors on these test cases
Checking we report expected black changes
1c1
< test_changes/black_preview.py:8:18: BLK100 Black would make changes.
---
> test_changes/black_preview.py:3:1: BLK100 Black would make changes.

@peterjc
Copy link
Owner

peterjc commented Nov 6, 2023

Looks like the double blank line behaviour has changed in preview mode:

$ flake8 --select BLK test_changes/black_preview.py --black-config with_pyproject_toml/pyproject.toml 
test_changes/black_preview.py:3:1: BLK100 Black would make changes.
[pcock@gruffalo tests]$ 
[pcock@gruffalo tests]$ 
[pcock@gruffalo tests]$ black --diff --preview test_changes/black_preview.py
--- test_changes/black_preview.py	2022-12-13 12:13:54+00:00
+++ test_changes/black_preview.py	2023-11-06 17:00:44.550105+00:00
@@ -1,11 +1,10 @@
 """Example showing future black string reformatting."""
-
 
 def hello():
     """Print variations on 'Hello World'."""
     # black v22.1.0 (first stable release) does not edit string literals,
     # so the following is untouched unless enable preview mode:
-    print("hello " "world")  # noqa: ISC001
+    print("hello world")  # noqa: ISC001
 
 
 hello()
would reformat test_changes/black_preview.py

All done! ✨ 🍰 ✨
1 file would be reformatted.

@peterjc
Copy link
Owner

peterjc commented Nov 6, 2023

I think this is an unwanted change in preview mode in black 23.10.0, see psf/black#4027

@peterjc
Copy link
Owner

peterjc commented Nov 7, 2023

Will wait for the next release of black which fixes this regression.

Did rest in a149f31

@peterjc
Copy link
Owner

peterjc commented Nov 7, 2023

Python 3.7 was working as only installed black 23.3.0

updates:
- [github.com/psf/black: 23.9.1 → 24.1.1](psf/black@23.9.1...24.1.1)
- [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](PyCQA/flake8@6.1.0...7.0.0)
@peterjc peterjc merged commit 2d92c84 into master Feb 5, 2024
31 checks passed
@peterjc peterjc deleted the pre-commit-ci-update-config branch February 5, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant