Skip to content

Commit

Permalink
Merge f2fb1a5 into c2eedfe
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei-Aksionov authored Nov 22, 2023
2 parents c2eedfe + f2fb1a5 commit a729e99
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/code_style_fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Automatic Code Style Fix

permissions: write-all


on:
pull_request:
branches: [main]
workflow_call:
secrets:
github-token:
description: "if provided an user GH's token, it will push update; requires `push` event"
required: false

jobs:
auto_code_style_fix:
runs-on: ubuntu-22.04
steps:
# - name: Checkout ️🛒
# uses: actions/checkout@v4
# with:
# ref: ${{ github.head_ref }}
# fetch-depth: 0

- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.github-token || github.token }}

- name: Black ◼️
uses: psf/black@stable
with:
# options: "-l120 -C --target-version py38 chat eval finetune generate lit_gpt notebooks pretrain quantize scripts tests xla"
options: "-l120 -C --target-version py38 notebooks src"
jupyter: true

- name: Ruff ®️
uses: chartboost/ruff-action@v1
with:
args: --select E,W,F,S --extend-select C4,SIM,RET,PT,I001,ANN001,ANN201,ANN205,ANN206,ARG001 --ignore E501,E731,S108,S101,S113,S603,PT007,S310,E402,PT004,C408 --per-file-ignores "*/**/__init__.py":I001,"tests/*":ANN --line-length 120 --target-version py38 --fix-only

# - name: Commit files ✔️
# run: |
# git config --local user.email "github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git diff-index --quiet HEAD || git commit -a -m "Automatic code-style fix."

# - name: Pushing changes 🛠 ️
# uses: ad-m/github-push-action@master
# with:
# branch: ${{ github.head_ref }}
# github_token: ${{ secrets.github-token || github.token }}
- name: Fixing Pull Request ↩️
# if: always() && inputs.push-fixes == true && steps.precommit.outcome == 'failure'
uses: actions-js/[email protected]
with:
# github_token: ${{ secrets.github-token || github.token }}
# github_token: ${{ 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 }}
# github_token: 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
# github_token: ${{ secrets.ruff_black_pat }}
github_token: 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
message: "pre-commit: running and fixing..."
branch: ${{ github.head_ref || github.ref_name }}
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test:
strategy:
Expand Down

0 comments on commit a729e99

Please sign in to comment.