Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Apply blacken-docs / the black code formatter#26

Open
MartinThoma wants to merge 2 commits into
zedr:master from
MartinThoma:blacken-docs
Open

Apply blacken-docs / the black code formatter #26
MartinThoma wants to merge 2 commits into
zedr:master from
MartinThoma:blacken-docs

Conversation

@MartinThoma

@MartinThoma MartinThoma commented Feb 12, 2022

Copy link
Copy Markdown
Contributor

Black is becomming the de-facto standard for code formatting in
Python. It makes sure code looks similar in many projects and it
leads to minimal diffs.

MartinThoma and others added 2 commits February 12, 2022 09:07
Black is becomming the de-facto standard for code formatting in
Python. It makes sure code looks similar in many projects and it
leads to minimal diffs.

zedr commented Feb 20, 2022

Copy link
Copy Markdown
Owner

Makes sense. Before I merge this, I'll take a look at integrating Black via its API so tests fail if it detects any style errors. Bear with me...

Copy link
Copy Markdown
Contributor Author

You can add a Github Action by creating .github/workflows/linting.yaml with the content:

name: Lint
on:
 push:
 branches: [ master ]
 pull_request:
 branches: [ master ]
jobs:
 build:
 runs-on: ubuntu-latest
 strategy:
 matrix:
 python-version: ["3.10"]
 steps:
 - uses: actions/checkout@v2
 - name: Set up Python ${{ matrix.python-version }}
 uses: actions/setup-python@v2
 with:
 python-version: ${{ matrix.python-version }}
 - name: Install dependencies
 run: |
 python -m pip install --upgrade pip
 python -m pip install blacken-docs
 - name: Test with blacken-docs
 run: |
 blacken-docs .

However, I'm uncertain if that will give a non-zero exit code when the check is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /