Fixes: #1662
Work-around for https://bugs.python.org/issue2142
The test has to slightly mess with its input data, because the utility
functions default to ensuring the test data has a final newline, which
defeats the point of the test.
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
* Add special-case for multi-line EOF TokenError under Python3.7
* Update conditional check to correspond to original issue description (and include issue hyperlink)
* Add warning and hint regarding replaying the fuzzer code generation
* Include code review suggestion (with modifications for this to follow)
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
* Remove Python version check, since this issue does exist across more recent Python versions than 3.7
* Update explanatory comment
* Add clarification for potentially-ambiguous blib2to3 import
* Update explanatory comment
* Bring comment into consistent format with previous comment
* Revert "Add clarification for potentially-ambiguous blib2to3 import"
This reverts commit 357b7cc03bdb19dd924f1accd428352f4bb44e5c.
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
Internal PRs (that come from branches of psf/black) match both the push
and pull_request events. This leads to a duplication of test, lint, etc.
checks on such PRs. Not only is it a waste of resources, it makes the
Status Checks UI more frustrating to go through.
Patch taken from:
https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
* Add test case to illustrate the issue
* Accept carriage returns as valid separators while enumerating comments
Without this acceptance, escaped multi-line statments that use carriage returns will not be counted into the 'ignored_lines' variable since the emitted line values will end with a CR and not an escape character. That leads to comments associated with the line being incorrectly labeled with the STANDALONE_COMMENT type, affecting comment placement and line space management.
* Remove comment linking to ephemeral build log
With older versions of prettier, when the hook failed a bunch of
"[error] No parser could be inferred for file: {PATH}" error lines
showed up because of lack of support of a flag that pre-commit
passes for us by default. It made figuring out why the prettier hook
failed annoying.
* Update example exclude to match only files in root
The `exclude` section of the example `pyproject.toml` file didn't work
as expected. It claimed to exclude matched files only in the project
root, but it actually excluded matched files at any directory level
within the project. We can address this by prepending `^/` to the regex
to ensure that it only matches files in the project root.
See https://github.com/psf/black/issues/1473#issuecomment-740008873 for
explanation.
* Mention excluding directories as well
* Gets gh-action ready for marketplace release
* Updates documentation and removes redundant gh-action input argument
* Fixes gh-action bug
This commit fixes a bug which caused not all input arguments were forwarder to the black formatter.
* Update README.md
Co-authored-by: Cooper Lees <me@cooperlees.com>
Co-authored-by: Cooper Lees <me@cooperlees.com>