Skip to content

Commit

Permalink
add action to check codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ManonMarchand committed Mar 15, 2024
1 parent 89bcff8 commit 713c33e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/codestyle-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: codestyle
on:
push:
branches:
- master
pull_request:
branches:
- master
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:

# Perform tests with coverage, build the doc and run the tests in the doc (only for python 3.8 on ubuntu)
test-cov-and-doc:
runs-on: ubuntu-latest
steps:
- name: "Checkout branch ${{ github.head_ref }}"
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: "Set up Python on Ubuntu"
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: "Set up npm"
uses: actions/setup-note@v4
- name: "JS codestyle"
run: |
npm install prettier
prettier --check .
- name: "Python codestyle"
run: |
pip install ".[dev]"
pip install ruff
ruff format --check .
ruff check --no-fix .
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = ["anywidget"]
readme = "README.md"

[project.optional-dependencies]
dev = ["watchfiles", "jupyterlab"]
dev = ["watchfiles", "jupyterlab", "ruff"]

# automatically add the dev feature to the default env (e.g., hatch shell)
[tool.hatch.envs.default]
Expand Down

0 comments on commit 713c33e

Please sign in to comment.