Skip to content

Fix Black #1910

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

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Fix Black #1910

merged 4 commits into from
Sep 27, 2023

Conversation

auscompgeek
Copy link
Member

Fixes #1909

@auscompgeek auscompgeek requested a review from pokey as a code owner September 23, 2023 14:28
@auscompgeek
Copy link
Member Author

auscompgeek commented Sep 23, 2023

😕 do we intentionally have invalid Python syntax in that playground file?

The check-ast pre-commit hook complains about it as well, if I add and run it:

check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1

data/playground/python/values.py: failed parsing with CPython 3.11.5:

    Traceback (most recent call last):
      File "~/.cache/pre-commit/repo_yfg8kuk/py_env-python3.11/lib/python3.11/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
        ast.parse(f.read(), filename=filename)
      File "/usr/local/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ast.py", line 50, in parse
        return compile(source, filename, mode, flags,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "data/playground/python/values.py", line 29
        val1 = 0, val2 = 5
        ^^^^^^^^
    SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?

@pokey
Copy link
Member

pokey commented Sep 23, 2023

I don't think it's necessarily a bad thing to have bad syntax in the playground

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there not a way to make the exclusion work?

@auscompgeek
Copy link
Member Author

auscompgeek commented Sep 23, 2023

I don't know, it was 1am my time and I just wanted to get black to format my code again

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok looks like force-exclude was supposed to be a regex. It's strange that there was no error thrown, just silently failing to format any files 🤔

@pokey pokey enabled auto-merge September 27, 2023 12:22
@auscompgeek
Copy link
Member Author

That's… quite amazing. Possibly worth filing an issue, but we should update black first.

@auscompgeek
Copy link
Member Author

Wait, I was running black on the command line wasn't I 😅

@pokey
Copy link
Member

pokey commented Sep 27, 2023

Wait, I was running black on the command line wasn't I 😅

yes, appears so, why?

@pokey pokey added this pull request to the merge queue Sep 27, 2023
Merged via the queue into main with commit 9ab56fd Sep 27, 2023
@pokey pokey deleted the fix-black branch September 27, 2023 12:43
pokey added a commit that referenced this pull request Sep 27, 2023
Fixes #1909

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <[email protected]>
fidgetingbits pushed a commit to fidgetingbits/cursorless that referenced this pull request Nov 3, 2023
Fixes cursorless-dev#1909

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <[email protected]>
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.

Black is not formatting anything
2 participants