Skip to content

Commit

Permalink
GitHub actions (#24)
Browse files Browse the repository at this point in the history
Added GitHub actions to automatically run black on python files
Co-authored-by: TanyaSpiden <[email protected]>
  • Loading branch information
golubevtanya authored Oct 5, 2023
1 parent 39113ac commit c1fc903
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: python auto-format
on:
# Triggers the workflow on push to all the branches and on pull request to the "master" or the "dev" branch
push:
pull_request:
branches: [ "master", "dev"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Install dependencies
run: |
python -m pip install -r requirements_git_actions.txt
- name: apply_black
run:
black --verbose .

- uses: psf/black@stable
with:
options: "--check --verbose"
src: "."
jupyter: true
version: "~= 22.0"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ ENV/
env.bak/
venv.bak/

#Data
data/

# Spyder project settings
.spyderproject
.spyproject
Expand Down
2 changes: 2 additions & 0 deletions requirements_git_actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
black==23.9.1
black[jupyter]

0 comments on commit c1fc903

Please sign in to comment.