Skip to content

Commit

Permalink
Add black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldEnd-Admin committed Sep 8, 2024
1 parent 17bd2ea commit a3e5428
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- '**.py'
- '.github/workflows/black.yml'
- 'requirements.txt'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Black
uses: psf/black@stable
with:
options: "--verbose"
src: "./Scripts"
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply formatting changes
skip_fetch: true
skip_checkout: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Prerequisites
You should have the following:

1. Python packages listed in `Scripts/requirements.txt`.
1. Python packages listed in `requirements.txt`.
2. (If exporting to PDF) `xelatex` in your PATH.
* If your TeX distribution does not support automatically installing missing packages, you'll also need to install all the necessary TeX packages to compile `Common/TeX/WorldEnd2_Common.tex`.

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.black]
target-version = ["py312"]
1 change: 1 addition & 0 deletions Scripts/requirements.txt → requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ colorlog
pylatexenc
regex
pint
black

0 comments on commit a3e5428

Please sign in to comment.