Skip to content

Commit f2d2e2a

Browse files
authored
Try isort and black checks (#9)
* Try isort and black checks * Put in isort order
1 parent acd615b commit f2d2e2a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# GitHub Action that uses Black to reformat the Python code in an incoming pull request.
2+
# If all Python code in the pull request is compliant with Black then this Action does nothing.
3+
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
4+
# https://github.com/cclauss/autoblack
5+
6+
name: isort and black check
7+
on: [pull_request]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python 3.13
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: 3.13
17+
- name: Install click, black and isort
18+
run: pip install 'click==8.0.4' 'black==23.12.1' 'isort==5.13.2'
19+
- name: Run isort --check .
20+
run: isort --check .
21+
- name: Run black --check .
22+
run: black --check .
23+
# - name: If needed, commit black changes to the pull request
24+
# if: failure()
25+
# run: |
26+
# black .
27+
# git config --global user.name 'autoblack'
28+
# git config --global user.email 'rocky@users.noreply.github.com'
29+
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
30+
# git checkout $GITHUB_HEAD_REF
31+
# git commit -am "fixup: Format Python code with Black"
32+
# git push

pymathics/hello/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
2828
"""
2929

30-
from pymathics.hello.version import __version__
3130
from pymathics.hello.__main__ import Hello
31+
from pymathics.hello.version import __version__
3232

3333
__all__ = ("__version__", "Hello", "pymathics_version_data")
3434

0 commit comments

Comments
 (0)