Skip to content

Commit

Permalink
testing automatic reformatter with test file
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanburmane committed Oct 12, 2024
1 parent 790cb61 commit d6938e0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
- 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!"
6 changes: 6 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# wrong formatting

j = [1,
2,
3
]

0 comments on commit d6938e0

Please sign in to comment.