Automatic markdown and YAML formatting with Prettier (#874)
This commit is contained in:
parent
ba2733dc81
commit
a6d866990e
@ -1,26 +1,26 @@
|
||||
install:
|
||||
- C:\Python36\python.exe -m pip install mypy
|
||||
- C:\Python36\python.exe -m pip install -e .[d]
|
||||
- C:\Python36\python.exe -m pip install mypy
|
||||
- C:\Python36\python.exe -m pip install -e .[d]
|
||||
|
||||
# Not a C# project
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- C:\Python36\python.exe tests/test_black.py
|
||||
- C:\Python36\python.exe -m mypy black.py blackd.py tests/test_black.py
|
||||
- C:\Python36\python.exe tests/test_black.py
|
||||
- C:\Python36\python.exe -m mypy black.py blackd.py tests/test_black.py
|
||||
|
||||
after_test:
|
||||
- C:\Python36\python.exe -m pip install pyinstaller
|
||||
- "%CMD_IN_ENV% C:\\Python36\\python.exe -m PyInstaller --clean -F --add-data blib2to3/;blib2to3 black.py"
|
||||
- "%CMD_IN_ENV% C:\\Python36\\python.exe -m PyInstaller --clean -F --add-data
|
||||
blib2to3/;blib2to3 black.py"
|
||||
|
||||
artifacts:
|
||||
- path: dist/black.exe
|
||||
|
||||
deploy:
|
||||
provider: GitHub
|
||||
description: ''
|
||||
description: ""
|
||||
auth_token:
|
||||
secure: uplI9CJ2dTGcEBCbZuIn+Qb4rC38hOoRSH9lcwuGCr5g9fSnhK1MZdNT6Cjf/mFL
|
||||
on:
|
||||
APPVEYOR_REPO_TAG: true
|
||||
|
||||
|
16
.github/CODE_OF_CONDUCT.md
vendored
16
.github/CODE_OF_CONDUCT.md
vendored
@ -1,13 +1,11 @@
|
||||
# Treat each other well
|
||||
|
||||
Everyone participating in the *Black* project, and in particular in the
|
||||
issue tracker, pull requests, and social media activity, is expected
|
||||
to treat other people with respect and more generally to follow the
|
||||
guidelines articulated in the [Python Community Code of
|
||||
Conduct](https://www.python.org/psf/codeofconduct/).
|
||||
Everyone participating in the _Black_ project, and in particular in the issue tracker,
|
||||
pull requests, and social media activity, is expected to treat other people with respect
|
||||
and more generally to follow the guidelines articulated in the
|
||||
[Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/).
|
||||
|
||||
At the same time, humor is encouraged. In fact, basic familiarity with
|
||||
Monty Python's Flying Circus is expected. We are not savages.
|
||||
At the same time, humor is encouraged. In fact, basic familiarity with Monty Python's
|
||||
Flying Circus is expected. We are not savages.
|
||||
|
||||
And if you *really* need to slap somebody, do it with a fish while
|
||||
dancing.
|
||||
And if you _really_ need to slap somebody, do it with a fish while dancing.
|
||||
|
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,37 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
title: ""
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
**Describe the bug** A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce** Steps to reproduce the behavior:
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Take this file '...'
|
||||
2. Run *Black* on it with these arguments '....'
|
||||
2. Run _Black_ on it with these arguments '....'
|
||||
3. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
**Expected behavior** A clear and concise description of what you expected to happen.
|
||||
|
||||
**Environment (please complete the following information):**
|
||||
|
||||
- Version: [e.g. master]
|
||||
- OS and Python version: [e.g. Linux/Python 3.7.4rc1]
|
||||
|
||||
**Does this bug also happen on master?**
|
||||
To answer this, you have two options:
|
||||
1. Use the online formatter at https://black.now.sh/?version=master, which will use the latest master branch.
|
||||
2. Or run *Black* on your machine:
|
||||
* create a new virtualenv (make sure it's the same Python version);
|
||||
* clone this repository;
|
||||
* run `pip install -e .`;
|
||||
* make sure it's sane by running `python setup.py test`; and
|
||||
* run `black` like you did last time.
|
||||
**Does this bug also happen on master?** To answer this, you have two options:
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
1. Use the online formatter at https://black.now.sh/?version=master, which will use the
|
||||
latest master branch.
|
||||
2. Or run _Black_ on your machine:
|
||||
- create a new virtualenv (make sure it's the same Python version);
|
||||
- clone this repository;
|
||||
- run `pip install -e .`;
|
||||
- make sure it's sane by running `python setup.py test`; and
|
||||
- run `black` like you did last time.
|
||||
|
||||
**Additional context** Add any other context about the problem here.
|
||||
|
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,20 +1,19 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
title: ""
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
**Is your feature request related to a problem? Please describe.** A clear and concise
|
||||
description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
**Describe the solution you'd like** A clear and concise description of what you want to
|
||||
happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
**Describe alternatives you've considered** A clear and concise description of any
|
||||
alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
**Additional context** Add any other context or screenshots about the feature request
|
||||
here.
|
||||
|
21
.github/ISSUE_TEMPLATE/style_issue.md
vendored
21
.github/ISSUE_TEMPLATE/style_issue.md
vendored
@ -1,30 +1,29 @@
|
||||
---
|
||||
name: Style issue
|
||||
about: Help us improve the Black style
|
||||
title: ''
|
||||
title: ""
|
||||
labels: design
|
||||
assignees: ''
|
||||
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
**Describe the style change**
|
||||
A clear and concise description of how the style can be improved.
|
||||
**Describe the style change** A clear and concise description of how the style can be
|
||||
improved.
|
||||
|
||||
**Examples in the current _Black_ style** Think of some short code snippets that show
|
||||
how the current _Black_ style is not great:
|
||||
|
||||
**Examples in the current *Black* style**
|
||||
Think of some short code snippets that show how the current *Black* style is not great:
|
||||
```
|
||||
def f():
|
||||
"Make sure this code is blackened"""
|
||||
pass
|
||||
```
|
||||
|
||||
**Desired style**
|
||||
How do you think *Black* should format the above snippets:
|
||||
**Desired style** How do you think _Black_ should format the above snippets:
|
||||
|
||||
```
|
||||
def f(
|
||||
):
|
||||
pass
|
||||
```
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
**Additional context** Add any other context about the problem here.
|
||||
|
@ -22,3 +22,9 @@ repos:
|
||||
hooks:
|
||||
- id: mypy
|
||||
exclude: ^docs/conf.py
|
||||
|
||||
- repo: https://github.com/prettier/prettier
|
||||
rev: 1.18.2
|
||||
hooks:
|
||||
- id: prettier
|
||||
args: [--prose-wrap=always, --print-width=88]
|
||||
|
@ -1,8 +1,8 @@
|
||||
- id: black
|
||||
name: black
|
||||
description: 'Black: The uncompromising Python code formatter'
|
||||
entry: black
|
||||
language: python
|
||||
language_version: python3
|
||||
require_serial: true
|
||||
types: [python]
|
||||
- id: black
|
||||
name: black
|
||||
description: "Black: The uncompromising Python code formatter"
|
||||
entry: black
|
||||
language: python
|
||||
language_version: python3
|
||||
require_serial: true
|
||||
types: [python]
|
||||
|
10
.travis.yml
10
.travis.yml
@ -4,14 +4,14 @@ cache:
|
||||
directories:
|
||||
- $HOME/.cache/pre-commit
|
||||
env:
|
||||
- TEST_CMD="coverage run tests/test_black.py"
|
||||
- TEST_CMD="coverage run tests/test_black.py"
|
||||
install:
|
||||
- pip install coverage coveralls pre-commit
|
||||
- pip install -e '.[d]'
|
||||
- pip install coverage coveralls pre-commit
|
||||
- pip install -e '.[d]'
|
||||
script:
|
||||
- $TEST_CMD
|
||||
- $TEST_CMD
|
||||
after_success:
|
||||
- coveralls
|
||||
- coveralls
|
||||
notifications:
|
||||
on_success: change
|
||||
on_failure: always
|
||||
|
@ -1,61 +1,54 @@
|
||||
# Contributing to *Black*
|
||||
|
||||
Welcome! Happy to see you willing to make the project better. Have you
|
||||
read the entire [user documentation](https://black.readthedocs.io/en/latest/)
|
||||
yet?
|
||||
# Contributing to _Black_
|
||||
|
||||
Welcome! Happy to see you willing to make the project better. Have you read the entire
|
||||
[user documentation](https://black.readthedocs.io/en/latest/) yet?
|
||||
|
||||
## Bird's eye view
|
||||
|
||||
In terms of inspiration, *Black* is about as configurable as *gofmt*.
|
||||
This is deliberate.
|
||||
In terms of inspiration, _Black_ is about as configurable as _gofmt_. This is
|
||||
deliberate.
|
||||
|
||||
Bug reports and fixes are always welcome! Please follow the [issue
|
||||
template on GitHub](https://github.com/psf/black/issues/new) for best
|
||||
results.
|
||||
|
||||
Before you suggest a new feature or configuration knob, ask yourself why
|
||||
you want it. If it enables better integration with some workflow, fixes
|
||||
an inconsistency, speeds things up, and so on - go for it! On the other
|
||||
hand, if your answer is "because I don't like a particular formatting"
|
||||
then you're not ready to embrace *Black* yet. Such changes are unlikely
|
||||
to get accepted. You can still try but prepare to be disappointed.
|
||||
Bug reports and fixes are always welcome! Please follow the
|
||||
[issue template on GitHub](https://github.com/psf/black/issues/new) for best results.
|
||||
|
||||
Before you suggest a new feature or configuration knob, ask yourself why you want it. If
|
||||
it enables better integration with some workflow, fixes an inconsistency, speeds things
|
||||
up, and so on - go for it! On the other hand, if your answer is "because I don't like a
|
||||
particular formatting" then you're not ready to embrace _Black_ yet. Such changes are
|
||||
unlikely to get accepted. You can still try but prepare to be disappointed.
|
||||
|
||||
## Technicalities
|
||||
|
||||
Development on the latest version of Python is preferred. As of this
|
||||
writing it's 3.8. You can use any operating system. I am using macOS
|
||||
myself and CentOS at work.
|
||||
Development on the latest version of Python is preferred. As of this writing it's 3.8.
|
||||
You can use any operating system. I am using macOS myself and CentOS at work.
|
||||
|
||||
Install all development dependencies using:
|
||||
|
||||
```
|
||||
$ pipenv install --dev
|
||||
$ pipenv shell
|
||||
$ pre-commit install
|
||||
```
|
||||
If you haven't used `pipenv` before but are comfortable with virtualenvs,
|
||||
just run `pip install pipenv` in the virtualenv you're already using and
|
||||
invoke the command above from the cloned *Black* repo. It will do the
|
||||
correct thing.
|
||||
|
||||
If you haven't used `pipenv` before but are comfortable with virtualenvs, just run
|
||||
`pip install pipenv` in the virtualenv you're already using and invoke the command above
|
||||
from the cloned _Black_ repo. It will do the correct thing.
|
||||
|
||||
Before submitting pull requests, run tests with:
|
||||
|
||||
```
|
||||
$ python setup.py test
|
||||
```
|
||||
|
||||
|
||||
## Hygiene
|
||||
|
||||
If you're fixing a bug, add a test. Run it first to confirm it fails,
|
||||
then fix the bug, run it again to confirm it's really fixed.
|
||||
|
||||
If adding a new feature, add a test. In fact, always add a test. But
|
||||
wait, before adding any large feature, first open an issue for us to
|
||||
discuss the idea first.
|
||||
If you're fixing a bug, add a test. Run it first to confirm it fails, then fix the bug,
|
||||
run it again to confirm it's really fixed.
|
||||
|
||||
If adding a new feature, add a test. In fact, always add a test. But wait, before adding
|
||||
any large feature, first open an issue for us to discuss the idea first.
|
||||
|
||||
## Finally
|
||||
|
||||
Thanks again for your interest in improving the project! You're taking
|
||||
action when most people decide to sit and watch.
|
||||
Thanks again for your interest in improving the project! You're taking action when most
|
||||
people decide to sit and watch.
|
||||
|
@ -2,9 +2,9 @@ name: black_docs
|
||||
channels:
|
||||
- conda-forge
|
||||
dependencies:
|
||||
- python>=3.6
|
||||
- Sphinx==1.7.2
|
||||
- pip:
|
||||
- recommonmark==0.4.0
|
||||
- git+https://git@github.com/psf/black.git
|
||||
- setuptools_scm==3.3.3
|
||||
- python>=3.6
|
||||
- Sphinx==1.7.2
|
||||
- pip:
|
||||
- recommonmark==0.4.0
|
||||
- git+https://git@github.com/psf/black.git
|
||||
- setuptools_scm==3.3.3
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: black
|
||||
type: sphinx
|
||||
conda:
|
||||
file: docs/environment.yml
|
||||
file: docs/environment.yml
|
||||
python:
|
||||
version: 3
|
||||
|
Loading…
Reference in New Issue
Block a user