diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 91c529d..542339d 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,10 +21,30 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: - uses: github/super-linter@v4 - env: - VALIDATE_ALL_CODEBASE: true - VALIDATE_PYTHON_BLACK: true - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + # Install black + - name: Install black + run: pip install black + + # Run black + - name: Run black + run: black --check . + + # Check for code changes + - name: Check for code changes + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + if [[ 'git status --porcelain' ]]; then + git add . + git commit -m "Auto-format code with black" + git push + fi + + # Success message + - name: Success + run: echo "Success!" \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 0000000..201480b --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +# wrong formatting + +j = [1, + 2, + 3 +] \ No newline at end of file