Skip to content

Validate BLACK_NUM_WORKERS values#5211

Open
MicroMilo wants to merge 1 commit into
psf:mainfrom
MicroMilo:fix-black-num-workers-validation
Open

Validate BLACK_NUM_WORKERS values#5211
MicroMilo wants to merge 1 commit into
psf:mainfrom
MicroMilo:fix-black-num-workers-validation

Conversation

@MicroMilo

Copy link
Copy Markdown

Summary

  • validate BLACK_NUM_WORKERS before using it to size the worker pool
  • report malformed, zero, or negative values as Click parameter errors that name the environment variable
  • add regression coverage for invalid BLACK_NUM_WORKERS values

Test Plan

  • python -m pytest tests/test_black.py::BlackTestCase::test_invalid_black_num_workers tests/test_black.py::BlackTestCase::test_works_in_mono_process_only_environment -q
  • python -m black src/black/concurrency.py tests/test_black.py --check

Fixes #5210

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.

Invalid BLACK_NUM_WORKERS value can produce a raw ValueError traceback

1 participant