Commit Graph

1003 Commits

Author SHA1 Message Date
Felix Hildén
921c24af80
Make Prettier preserve line ending type (#2244)
Why? The default in Prettier 2.0 was
[changed](https://prettier.io/docs/en/options.html#end-of-line) from
`auto` to `LF`. This makes development on Windows awkward, because
every file is marked with changes both by Prettier and then by Git
regardless of repository line ending settings, making committing harder
than it should be.

---

Aside from that: I noticed that runnin pre-commit manually seems to add
line endings to symlink files, but they disappear when actually committing.
Don't know if that's a known.. quirk..(?) or not.

---

Commit history before merge:

* Make Prettier preserve line ending type
* Move options to .prettierrc
2021-05-17 14:38:43 -04:00
Hadi Alqattan
b8450b9fae
Fix: black only respects the root gitignore. (#2225)
Commit history before merge:

Black now respects .gitignore files in all levels, not only root/.gitignore file
(apply .gitignore rules like git does).

* Fix: typo
* Fix: respect .gitignore files in all levels.
* Add: CHANGELOG note.
* Fix: TypeError: unsupported operand type(s) for +: 'NoneType' and 'PathSpec'
* Update docs.
* Fix: no parent .gitignore
* Add a comment since the if expression is a bit hard to understand
* Update tests - conver no parent .gitignore case.
* Use main's Pipfile.lock instead

  The original changes in Pipfile.lock are whitespace only. The changes
  turned the JSON's file indentation from 4 to 2. Effectively this
  happened: `json.dumps(json.loads(old_pipfile_lock), indent=2) + "\n"`.

  Just using main's Pipfile.lock instead of undoing the changes because
  1) I don't know how to do that easily and quickly, and 2) there's a
  merge conflict.

  Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>

* Merge remote-tracking branch 'upstream/main' into i1730 …
  
  conflicts for days ay?
2021-05-16 13:51:27 -04:00
Łukasz Langa
60f8bd2c89
Include Jelle's review suggestions 2021-05-16 18:24:28 +02:00
Matthew Clapp
9704922cf9
Update vim plugin manual installation instructions. (#2235) 2021-05-16 18:10:59 +02:00
Richard Si
403ce1a18a
Add issue triage documentation (#2236)
* Add issue triage documentation

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-16 18:07:27 +02:00
Richard Si
904fe94ceb
Add lower bound for aiohttp-cors + fix primer (#2231)
It appears sqlalchemy has recently reformatted their project with
Black 21.5b1.

Most of our dependencies have a lower bound and creating a test
environment with the oldest acceptable dependencies runs the full
Black test suite just fine. The only exception to this is aiohttp-cors.
It's unbounded and the oldest version 0.1.0 until 0.4.0 breaks the
test suite in such an old environment.

Failure with 0.1.0:

```
tests/test_blackd.py:10: in <module>
    import blackd
testenv/lib/python3.8/site-packages/blackd/__init__.py:12: in <module>
    import aiohttp_cors
testenv/lib/python3.8/site-packages/aiohttp_cors/__init__.py:29: in <module>
    from .urldispatcher_router_adapter import UrlDistatcherRouterAdapter
testenv/lib/python3.8/site-packages/aiohttp_cors/urldispatcher_router_adapter.py:27: in <module>
    class UrlDistatcherRouterAdapter(RouterAdapter):
testenv/lib/python3.8/site-packages/aiohttp_cors/urldispatcher_router_adapter.py:32: in UrlDistatcherRouterAdapter
    def route_methods(self, route: web.Route):
E   AttributeError: module 'aiohttp.web' has no attribute 'Route'
```

For 0.2.0:

```
tests/test_blackd.py:10: in <module>
    import blackd
testenv/lib/python3.8/site-packages/blackd/__init__.py:12: in <module>
    import aiohttp_cors
testenv/lib/python3.8/site-packages/aiohttp_cors/__init__.py:27: in <module>
    from .cors_config import CorsConfig
testenv/lib/python3.8/site-packages/aiohttp_cors/cors_config.py:24: in <module>
    from .urldispatcher_router_adapter import UrlDistatcherRouterAdapter
testenv/lib/python3.8/site-packages/aiohttp_cors/urldispatcher_router_adapter.py:27: in <module>
    class UrlDistatcherRouterAdapter(AbstractRouterAdapter):
testenv/lib/python3.8/site-packages/aiohttp_cors/urldispatcher_router_adapter.py:32: in UrlDistatcherRouterAdapter
    def route_methods(self, route: web.Route):
E   AttributeError: module 'aiohttp.web' has no attribute 'Route'
```

For 0.3.0:

```
ERROR: Cannot install aiohttp-cors==0.3.0 and aiohttp==3.6.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested aiohttp==3.6.0
    aiohttp-cors 0.3.0 depends on aiohttp<=0.20.2 and >=0.18.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
```
2021-05-13 12:30:34 -07:00
Christian Clauss
445f094f1f
Use codespell to find typos (#2228) 2021-05-13 10:28:41 -07:00
Richard Si
3ef339b2e7
Modify when Test, Primer, and Documentation Build run (#2226)
- Test and Primer don't run for documentation only changes since it's
  unnecessary, eating unnecessary cycles and slowing down CI since these
  workflows eat up the 20 max workers limit quite easily!

- Documentation Build runs all of the time now since quite a bit of the
  content depends on Black's code so even a simple 1-file change in
  src/black/__init__.py may break the docs build. It's not like this is
  a costly workflow anyway.

Fuzz is still running on all changes because with fuzzing, the more the
better in general. 6 or 7 jobs on a documentation only commit is much
better than 27/28 jobs anyway :p

I also found an error in our bug report issue template :)
2021-05-12 21:28:41 -04:00
Łukasz Langa
b2ee211b5a
Click 8.0 renamed its "die on LANG=C" function so we need to look for that one too (#2227) 2021-05-12 21:47:32 +02:00
Richard Si
94a0b07dbe
Remove useless flake8 config + test support code (#2221)
We've depended on Click 7.x ever since we broke CI systems across the
world (oops lol) and flake8-mypy was purged a fair bit back: #1867

Also remove the primer tests import in tests/test_black.py because it's
annoying when just trying to actually target tests/test_black.py tests.
`pytest -k test_black.py` doesn't do what you expect due to that import.
2021-05-11 14:09:33 -04:00
Cooper Lees
53d9bace12
Add stable tag process to release process documentation (#2224)
* Add stable tag process to release process documentation
- Add reasoning + step commands

* Bah - I ran the linter but forgot to commit

* Update docs/contributing/release_process.md

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-11 10:01:03 -07:00
Jelle Zijlstra
2f52e4b492
fix typo (#2217) 2021-05-10 08:01:53 -07:00
Cooper Lees
f933e8a838
Update CHANGES.md for 21.5b1 release (#2215) 2021-05-10 07:59:32 -07:00
Cooper Lees
f1ce47bd2b
Release process docs (#2214)
* Setup groundwork for release process docs

I'm using MyST for the index page since I like it more and it's easier
to work with.

* Fill in Release Process for black

* Apply suggestions from code review

Apply Jelle's grammar + typo fixes. I am a terrible only English speaker.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Update release_process.md

Make lint happy via web UI.

* Move to contribution section and fix prettier

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-10 07:58:36 -07:00
Richard Si
7c851dfa2c
Cover more in the usage docs (#2208)
Commit history before merge:

* Cover more in the usage docs
* Minor fixes
* Even more corrections by Jelle
* Update docs/usage_and_configuration/the_basics.md

  Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-10 10:57:22 -04:00
Richard Si
3d96b7f10a
Autogenerate black(d|-primer)? help in usage docs (#2212)
So these won't go out of date. This does mean the environment has be
setup a bit more carefully so the right version of the tool is used,
but thankfully the build environment is rebuilt on change on RTD anyway.

Also since the HTML docs are known to build fine, let's provide
downloadable HTMLzips of our docs.

This change needs RTD and GH to install Black with the [d] extra so
blackd's help can generated. While editing RTD's config file, let's
migrate the file to a non-deprecated filename.

Also I missed adding AUTHORS.md to the files key in the doc GHA config.
2021-05-09 19:35:56 -07:00
Panagiotis Vasilopoulos
06ccb88bf2
Replace references to master branch (#2210)
Commit history before merge:

* Replace references to master branch
* Update .flake8 to reference docs on RTD

  We're moving away from GitHub as a documentation host to only RTD because
  it's makes our lives easier creating good docs. I know this link is dead right now,
  but it won't be once we release a new version with the documentation reorganization
  changes (which should be soon!).

  Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-09 17:50:17 -04:00
Cooper Lees
5020577788
Remove docker CI from look at 'master' branch (#2209) 2021-05-09 09:08:03 +02:00
Richard Si
1bedc176d1
Fix autodoc refs broken by refactor (#2207) 2021-05-08 21:53:01 +02:00
Richard Si
62bfbd6a63
Reorganize docs v2 (GH-2174)
I know I know, this is the second reorganization of the docs. I'm not
saying the first one was bad or anything... but.. actually wait nah,
*it was bad*.

Anyway, welcome to probably my biggest commit. The main thing with this
reorganization was to introduce nesting to the documentation! Having
all of the docs be part of the main TOC was becoming too much. There
wasn't much room to expand either. Finally, the old setup required
a documentation generation step which was just annoying.

The goals of this reorganization was to:

1. Significantly restructure the docs to be discoverable and
   understandable

2. Add room for further docs (like guides or contributing docs)

3. Get rid of the doc generation step (it was slow and frustrating)

4. Unblock other improvements and also just make contributing to the
   docs easier

Another important change with this is that we are no longer using GitHub
as a documentation host. While GitHub does support Markdown based docs
actually pretty well, the lack of any features outside of GitHub Flavoured
Markdown is quite limiting. ReadTheDocs is just much better suited for
documentation. You can use reST, MyST, CommonMark, and all of their
great features like toctrees and admonitions.

Related to this change, we're adopting MyST as our flavour of Markdown.
MyST introduces neat syntax extensions to Markdown that pretty much
gives us the best of both worlds. The ease of use and simplicity of MD
and the flexibility and expressiveness of reST. Also recommonmark is
deprecated now. This switch was possible now we don't use GH as a docs
host. MyST docs have to be built to really be usable / pretty, so the MD
docs are going to look pretty bad on GH, but that's fine now!

Another thing that should be noted is that the README has been stripped
of most content since it was confusing. Users would read the README and
then think some feature or bug was fixed already and is available in a
release when in reality, they weren't. They were reading effectively
the latest docs without knowing.

See also: https://github.com/psf/black/issues/1759

FYI: CommonMark is a rationalized version of Markdown syntax

--

Commit history before merge:

* Switch to MyST-Parser + doc config cleanup

  recommonmark is being deprecated in favour of MyST-Parser. This change
  is welcomed, especially since MyST-Parser has syntax extensions for the
  Commonmark standard. Effectively we get to use a language that's powerful
  and expressive like ReST, but get the simplicity of Markdown.

  The rest of this effort will be using some MyST features.

  This reorganization efforts aims to remove as much duplication as possible.
  The regeneration step once needed is gone, significantly simplifing our
  Sphinx documentation configuration.

* Tell pipenv we replaced recommonmark for MyST-Parser

  Also update `docs/requirements.txt`

* Delete all auto generated content
* Switch prettier for mdformat (plus a few plugins)

  **FYI: THIS WAS EFFECTIVELY REVERTED, SEE THIRD TO LAST COMMIT**

  prettier doesn't support MyST's syntax extensions which are going to be
  used in this reorganization effort so we have to switch formatter.

  Unfortanately mdformat's style is different from prettier's so time to
  reformat the whole repo too.

  We're excluding .github/ISSUE_TEMPLATE because I have no idea whether
  its changes are safe, so let's play it safe.

* Fix the heading levels in CHANGES.md + a link

  MyST-Parser / sphinx's linkcheck complains otherwise.

* Move reference docs into a docs/contributing dir

  They're for contributors of Black anyway. Also added a note in the
  summary document warning about the lack of attention the reference has
  been dealing with.

* Rewrite and setup the new landing page + main TOC

  - add some more detail about Black's beta status
  - add licensing info
  - add external links in the main TOC for GitHub, PyPI, and IRC
  - prepare main TOC for new structure

* Break out AUTHORS into its own file

  Not only was the AUTHORS list quite long, this makes it easy to include
  it in the Sphinx docs with just a simple symlink.

* Add license to docs via a simple include

  Yes the document is orphaned but it is linked to in the landing page
  (docs/index.rst).

* Add "The Black Code Style" section

  This mostly was a restructuring commit, there has been a few updates but
  not many. The main goal was to split "current style" and "planned
  changes to the style that haven't happened yet" to avoid confusion.

* Add "Getting Started" page

  This is basically a quick start + even more. This commit is certainly
  one of most creatively involved in this effort.

* Add "Usage and Configuration" section

  This commit was as much restructuring as new content. Instead of being
  in one giant file, usage and configuration documentation can expand
  without bloating a single file.

* Add "Integrations" section

Just a restructuring commit ...

* Add "Guides" section

  This is a promising area of documentation that could easily grow in the
  future, let's prepare for that!

* Add "Contributing" section

  This is also another area that I expect to see significant growth in.
  Contributors to Black could definitely do with some more specific docs
  that clears up certain parts of our slightly confusing project (it's
  only confusing because we're getting big and old!).

* Rewrite CONTRIBUTING.md to just point to RTD
* Rewrite README.md to delegate most info to RTD
* Address feedback + a lot of corrections and edits

  I know I said I wanted to do these after landing this but given there's
  going to be no time between this being merged and a release getting
  pushed, I want these changes to make it in.

  - drop the number flag for mdformat - to reduce diffs, see also:
    https://mdformat.readthedocs.io/en/stable/users/style.html#ordered-lists
  - the GH issue templates should be safe by mdformat, so get rid of the
    exclude
  - clarify our configuration position - i.e. stop claiming we don't have
    many options, instead say we want as little formatting knobs as
    possible
  - lots and lots of punctuation, spelling, and grammar corrections (thanks
    Jelle!)
  - use RTD as the source for the CHANGELOG too
  - visual style cleanups
  - add docs about our .gitignore behaviour
  - expand GHA Action docs
  - clarify we want the PR number in the CHANGELOG entry
  - claify Black's behaviour for with statements post Python 3.9
  - italicize a bunch of "Black"s

  Thank you goes to Jelle, Taneli (hukkinj1 on GH), Felix
  (felix-hilden on GH), and Wouter (wbolster on GH) for the feedback!

* Merge remote-tracking branch 'upstream/master' into reorganize-docs-v2

  merge conflicts suck, although these ones weren't too bad.

* Add changelog entry + fix merge conflict resolution error

  I consider this important enough to be worthy of a changelog entry :)

* Merge branch 'master' into reorganize-docs-v2

  Co-authored-by: Łukasz Langa <lukasz@langa.pl>

* Actually let's continue using prettier

  Prettier works fine for all of the default MyST syntax so let's not
  rock the boat as much. Dropping the mdformat commit was merge-conflict
  filled so here's additional commit instead.

* Address Cooper's, Taneli's, and Jelle's feedback

  Lots of wording improvements by Cooper. Taneli suggested to disable the
  enabled by default MyST syntax not supported by Prettier and I agreed.
  And Jelle found one more spelling error!

* More minor fixes
2021-05-08 15:17:38 -04:00
Richard Si
036bea4aa0
Speed up tests even more (#2205)
There's three optimizations in this commit:

1. Don't check if Black's output is stable or equivalant if no changes
   were made in the first place. It's not like passing the same code
   (for both source and actual) through black.assert_equivalent or
   black.assert_stable is useful. It's not a big deal for the smaller
   tests, but it eats a lot of time in tests/test_format.py since
   its test cases are big. This is also closer to how Black works IRL.

2. Use a smaller file for `test_root_logger_not_used_directly` since
   the logging it's checking happens during blib2to3's startup so the
   file doesn't really matter.

3. If we're checking a file is formatting (i.e. test_source_is_formatted)
   don't run Black over it again with `black.format_file_in_place`.
   `tests/test_format.py::TestSimpleFormat.check_file` is good enough.
2021-05-08 11:34:25 +02:00
Łukasz Langa
f2ea461e9e
Refactor src/black/__init__.py into many files (#2206)
* Move string-related utility to functions to strings.py, const.py
* Move Leaf/Node-related functionality to nodes.py
* Move comment-related functions to comments.py
* Move caching to cache.py and Mode/TargetVersion/Feature to mode.py
* Move some leftover functions to nodes.py, comments.py, strings.py
* Add missing files to source list for test runs
* Move line-related functionality into lines.py, brackets into brackets.py
* Move transformers to trans.py
* Move file handling, output, parsing, concurrency, debug, and report
* Move two more functions to nodes.py
* Add CHANGES
* Add numeric.py
* Add linegen.py
* More docstrings
* Include new files in tests

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-08 11:29:47 +02:00
Richard Si
4fc1354aeb
Speed up test suite via distributed testing (#2196)
* Speed up test suite via distributed testing

Since we now run the test suite twice, one with Python 2 and another
without, full test runs are getting pretty slow. Let's try to
fix that with parallization.

Also use verbose mode on CI since more logs is usually better since
getting more is quite literally impossible.

The main issue we'll face with this is we'll hit
https://github.com/pytest-dev/pytest-xdist/issues/620 sometimes
(although pretty rarely). I suppose we can test this and see if how bad
this bug is for us, and revert if necessary down the line.

Also let's have some colours 🎉
2021-05-07 16:41:55 +02:00
Łukasz Langa
d0e06b53b0
Mark blackd tests with the blackd optional marker (#2204)
This is a follow-up of #2203 that uses a pytest marker instead of a bunch of
`skipUnless`.  Similarly to the Python 2 tests, they are running by default and
will crash on an unsuspecting contributor with missing dependencies.  This is
by design, we WANT contributors to test everything.  Unless we actually don't
and then we can run:

  pytest --run-optional=no_blackd

Relatedly, bump required aiohttp to 3.6.0 at least to get rid of expected
failures on Python 3.8 (see 6b5eb7d465).
2021-05-07 16:33:36 +02:00
Łukasz Langa
e4b4fb02b9
Use optional tests for "no_python2" to simplify local testing (#2203) 2021-05-07 15:03:13 +02:00
Kaleb Barrett
1fe2efd857
Do not use gitignore if explicitly passing excludes (#2170)
Closes #2164.

Changes behavior of how .gitignore is handled. With this change, the rules in .gitignore are only used as a fallback if no exclusion rule is explicitly passed on the command line or in pyproject.toml. Previously they were used regardless if explicit exclusion rules were specified, preventing any overriding of .gitignore rules.

Those that depend only on .gitignore for their exclusion rules will not be affected. Those that use both .gitignore and exclude will find that exclude will act more like actually specifying exclude and not just another extra-excludes. If the previous behavior was desired, they should move their rules from exclude to extra-excludes.
2021-05-07 14:54:21 +02:00
Richard Si
4b7b5ed5b8
Fix broken Action entrypoint (#2202) 2021-05-06 12:21:13 -07:00
Shota Ray Imaki
5316836393
Simplify GitHub Action entrypoint (#2119)
This commit simplifies entrypoint.sh for GitHub Actions by removing
duplication of args and black_args (cf. #1909).

The reason why #1909 uses the input id black_args is to avoid an overlap
with args, but this naming seems redundant. So let me suggest option
and src, which are consistent with CLI. Backward compatibility is
guaranteed; Users can still use black_args as well.

Commit history pre-merge:
* Simplify GitHub Action entrypoint (#1909)
* Fix prettier
* Emit a warning message when `black_args` is used

  This deprecation should be visible in GitHub Action's UI now.

  Co-authored-by: Shota Ray Imaki <shota.imaki.0801@gmail.com>
  Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-05 22:25:43 -04:00
Cooper Lees
07c8812937
Enable --experimental-string-processing on most primer projects (#2184)
* Enable ` --experimental-string-processing` on all primer projects
- We want to make this default so need to test it more
- Fixed splat/star bug in extending black args for each project

* Disable sqlalchemy due to crash
2021-05-05 08:33:23 -07:00
Cooper Lees
14c76e8971
Disable pandas while we look into #2193 (#2195) 2021-05-04 12:49:20 -07:00
Cooper Lees
d8a034f9b6
Update CHANGES.md for 21.5b0 release (#2192)
* Update CHANGES.md for 21.5b0 release

* Make prettier happy
2021-05-04 11:07:08 -07:00
Hugo van Kemenade
267bc5dde9
Use pre-commit/action to simplify CI (#2191) 2021-05-04 13:41:04 +02:00
reka
0c60ccc066
compatible isort config: mention profile first (#2180)
Change the order of possible ways to configure isort:
1. using the profile black
2. custom configuration

Formats section:
change the examples to use the profile black

Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-05-04 10:48:59 +02:00
Richard Si
5918a016ff
Drop Travis CI and migrate Coveralls (#2186)
Travis CI for Open Source is shutting down in a few weeks so the queue
for jobs is insane due to lower resources. I'm 99.99% sure we don't need
it as our Test, Lint, Docs, Upload / Package, Primer, and Fuzz workflows
are all on GitHub Actions. So even though we *can* migrate to the .com
version with its 1000 free Linux minutes(?), I don't think we need to.

more information here:
- https://blog.travis-ci.com/oss-announcement
- https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
- https://docs.travis-ci.com/user/migrate/open-source-repository-migration

This commit does the following:
- delete the Travis CI configuration
- add to the GHA test workflows so coverage continues to be recorded
  - tweaked coverage configuration so this wouldn't break
- remove any references to Travis CI in the docs (i.e. readme + sphinx
  docs)

Regarding the Travis CI to GitHub Actions Coveralls transition, the
official action doesn't support the coverage files produced by coverage.py
unfornately. Also no, I don't really know what I am doing so don't @ me
if this breaks :p (well you can, but don't expect me to be THAT useful).

The Coveralls setup has two downfalls AFAIK:
- Only Linux runs are used because AndreMiras/coveralls-python-action
  only supports Linux. Although this isn't a big issue since the Travis
  Coveralls configuration only used Linux data too.
- Pull requests from an internal branch (i.e. one on psf/black) will be
  marked as a push coverage build by Coveralls since our anti-duplicate-
  workflows system runs under the push even for such cases.
2021-05-04 10:47:59 +02:00
KotlinIsland
204f76e0c0
add test configurations that don't contain python2 optional install (#2190)
add test for negative scenario: formatting python2 code
tag python2 only tests

Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2021-05-04 10:47:22 +02:00
Richard Si
e42f9921e2
Detect '@' dotted_name '(' ')' NEWLINE as a simple decorator (#2182)
Previously the RELAXED_DECORATOR detection would be falsely True on that
example. The problem was that an argument-less parentheses pair didn't
pass the `is_simple_decorator_trailer` check even it should. OTOH a
parentheses pair containing an argument or more passed as expected.
2021-05-04 10:46:46 +02:00
Cooper Lees
a18c7bc099
primer: Add --no-diff option (#2187)
- Allow runs with no code diff output
- This is handy for reducing output to see which file is erroring

Test:
- Edit config for 'channels' to expect no changes and run with `--no-diff` and see no diff output
2021-05-04 10:44:40 +02:00
Cooper Lees
a669b64091
primer: Renable pandas (#2185)
- It no longer crashes black so we should test on it's code
- Update django reason to name the file causing error
  - Seems it has a syntax error on purpose
2021-05-03 14:58:17 -07:00
Bryan Forbes
35e8d1560d
Set is_pyi if stdin_filename ends with .pyi (#2169)
Fixes #2167

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-02 14:48:54 +02:00
Hugo van Kemenade
24bd6b983a
Tox has been formatted with Black 21.4b0 (#2175) 2021-05-01 12:17:20 -07:00
Kaleb Barrett
00491e1dcb
Add ability to pass posargs to pytest run in tox.ini (#2173) 2021-05-01 14:47:59 -04:00
Łukasz Langa
b39999da7f
Elaborate on what AST changes Black might perform 2021-04-28 16:50:02 +02:00
Cooper Lees
682077c15e
Update CHANGELOG for 21.4b2 release (#2162) 2021-04-28 16:21:56 +02:00
Miro Hrončok
89a856d742
Remove useless shebangs in non-executable files (#2161)
Such shebangs are only ever used if the file is executed directly, i.e.:

    $ /usr/lib/python3.9/site-packages/black_primer/cli.py

But that doesn't work:

    $ /usr/lib/python3.9/site-packages/black_primer/cli.py
    bash: /usr/lib/python3.9/site-packages/black_primer/cli.py: Permission denied

The lib file even has: "lib is a library, funnily enough"
2021-04-28 07:07:15 -07:00
Cooper Lees
04fd4432f6
Add automatic version tagging to Docker CI Pushes (#2132)
* Add automatic version tagging to Docker Uploads
- If the git comment has a tag, set that on the docker images pushed
- If we don't have a tag, we just set `latest_non_release`

* Add trigger on release creation too

* Make prettier happy omn docker.yml
2021-04-27 20:10:44 -07:00
Jelle Zijlstra
ad1696422b
Ignore inaccessible user config (#2158)
Fixes #2157
2021-04-27 14:16:35 -07:00
Jelle Zijlstra
807a65f9d5
Update discussion of AST safety check in README (#2159) 2021-04-27 14:00:17 -07:00
Miro Hrončok
76e1602d60
Install primer.json (used by black-primer by default) with black (#2154)
Fixes https://github.com/psf/black/issues/2153
2021-04-27 08:58:39 -07:00
Jelle Zijlstra
82a53999ea
Add pyanalyze and typeshed to black-primer (#2152)
pyanalyze is one of my projects and it uses `--experimental-string-processing`.

typeshed has a lot of stub files.
2021-04-27 08:33:51 -07:00
Cooper Lees
1728bb441e
Update CHANGELOG for 21.4b1 release (#2151)
* Update CHANGELOG for 21.4b1 release

* Add pathspec minimum bump + update primer not to expect changes for virtualenv
2021-04-27 07:40:08 -07:00