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

black aborted under pre-commit #738

Closed
RonnyPfannschmidt opened this issue Mar 8, 2019 · 3 comments
Closed

black aborted under pre-commit #738

RonnyPfannschmidt opened this issue Mar 8, 2019 · 3 comments

Comments

@RonnyPfannschmidt
Copy link

on a repo i cant share publically we have a linting stage that invokes black via pre-commit

on occasion we observe an "aborted" from black in that pileline,

resulting in output like


$ pre-commit run --all
[INFO] Initializing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Initializing environment for https://github.com/ambv/black.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Installing environment for https://github.com/asottile/reorder_python_imports.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/pyupgrade.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/ambv/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Reorder python imports...................................................Passed
black....................................................................Failed
hookid: black

Aborted!

Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check Yaml...............................................................Passed
Debug Statements (Python)................................................Passed
Flake8...................................................................Passed
pyupgrade................................................................Passed

the pre-commit configuration is

repos:
- repo: https://github.com/asottile/reorder_python_imports
  rev: v1.3.3
  hooks:
  - id: reorder-python-imports
    language_version: python3
- repo: https://github.com/ambv/black
  rev: 18.9b0
  hooks:
  - id: black
    args: [--safe, --quiet, --line-length, "100"]
    language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v2.0.0
  hooks:
  - id: trailing-whitespace
    language_version: python3
  - id: end-of-file-fixer
    language_version: python3
  - id: check-yaml
    language_version: python3
  - id: debug-statements
    language_version: python3
  - id: flake8
    language_version: python3
- repo: https://github.com/asottile/pyupgrade
  rev: v1.10.1
  hooks:
  - id: pyupgrade
    language_version: python3

the error only crops up on rare occasions and i would appreciate suggestions for better debugging
we are running it under a gitlab ci runner

cc @asottile

@asottile
Copy link
Contributor

asottile commented Mar 8, 2019

This is fixed on master but there hasn't been a release.

#673 (comment) outlines the workaround until black makes a tagged release (or you can pre-commit autoupdate --bleeding-edge https://github.com/ambv/black)

@asottile
Copy link
Contributor

asottile commented Mar 8, 2019

#674 and #675 contained the fixes

@RonnyPfannschmidt
Copy link
Author

@asottile awesome, thanks for the swift answer

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

No branches or pull requests

2 participants