cobalt
8bf04549ff
Consistently add trailing comma on typed parameters ( #4164 )
...
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-01-27 13:55:22 -08:00
Jelle Zijlstra
bb588073ab
Fix parser bug where "type" was misinterpreted as a keyword inside a match ( #3950 )
...
Fixes #3790
Slightly hacky, but I think this is correct and it should also improve performance somewhat.
2023-10-17 00:59:15 -07:00
Shantanu
c1e30d97fe
Fix most blib2to3 lint ( #3794 )
2023-07-16 21:33:58 -07:00
Shantanu
0b4d7d55f7
Run pyupgrade on blib2to3 and src ( #3771 )
2023-07-09 15:05:01 -07:00
Yilei "Dolee" Yang
dd0e912a6e
Fix import of blib2to3.pgen2.driver ( #3546 )
2023-02-03 22:00:09 -08:00
Shantanu
680cbe3a4f
Use --no-implicit-optional for type checking ( #3220 )
...
This makes type checking PEP 484 compliant (as of 2018).
mypy will change its defaults soon.
See:
https://github.com/python/mypy/issues/9091
https://github.com/python/mypy/pull/13401
2022-08-12 19:28:47 -07:00
Batuhan Taskaya
7a29568115
Don't make redundant copies of the DFA ( #2763 )
2022-01-13 18:01:44 -08:00
Batuhan Taskaya
0f26a0369e
Fix handling of standalone match/case with newlines/comments ( #2760 )
...
Resolves #2759
2022-01-10 12:22:07 -08:00
Batuhan Taskaya
3e731527e4
Speed up new backtracking parser ( #2728 )
2022-01-10 10:22:00 -08:00
Batuhan Taskaya
28ab82aab0
perf: drop the initial stack copy ( #2670 )
...
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-12-05 13:03:48 -08:00
Richard Si
117891878e
Implementing mypyc support pt. 2 ( #2431 )
2021-11-15 20:24:16 -08:00
Batuhan Taskaya
1e0ec543ff
black/parser: partial support for pattern matching ( #2586 )
...
Partial implementation for #2242 . Only works when explicitly stated -t py310.
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2021-11-13 19:15:31 -08:00
Hadi Alqattan
b3ceb293d9
Remove unused import statements using Pycln. ( #2021 )
...
* remove unused imports using Pycln.
* reverse comma style.
2021-03-05 11:58:00 -08:00
Cooper Lees
2082a325fd
Refactor black into packages in src/ dir ( #1376 )
...
- Move black.py to src/black/__init__.py
- Have setuptools_scm make src/_black_version.py and exclude from git
- Move blackd.py to src/blackd/__init__.py
- Move blib2to3/ to src/
- Update `setup.py`
- Update unittests to pass
- Mostly path fixing + resolving
- Update CI
- pre-commit config
- appveyor + travis
Tested on my mac with python 3.7.5 via:
```
python3 -m venv /tmp/tb3
/tmp/tb3/bin/pip install --upgrade setuptools pip coverage pre-commit
/tmp/tb2/bin/pip install ~/repos/black/
cd ~/repos/black/
/tmp/tb2/bin/coverage run tests/test_black.py
/tmp/tb3/bin/pre-commit run -a
/tmp/tb3/bin/black --help
/tmp/tb3/bin/black ~/repos/ptr/ptr.py
```
2020-05-08 08:50:50 -07:00