Skip to content

Commit 3af3e27

Browse files
authored
Merge pull request #11 from scadable/4/lint
Linters
2 parents 89bfe80 + 8125b50 commit 3af3e27

File tree

8 files changed

+58
-11
lines changed

8 files changed

+58
-11
lines changed

.github/workflows/lint-project.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Pre-Commit Hooks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
pre-commit:
9+
name: Pre-commit checks
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.13'
19+
- name: Cache pip
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-
26+
${{ runner.os }}-
27+
- name: Install pre-commit
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install pre-commit
31+
- name: Run pre-commit
32+
run: pre-commit run --all-files

.github/workflows/test-project.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Scadable Tests
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review]
6-
push:
7-
branches:
8-
- main
6+
# push:
7+
# branches:
8+
# - main
99

1010
jobs:
1111
test:

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

@@ -207,4 +207,4 @@ marimo/_lsp/
207207
__marimo__/
208208

209209
# Pycharm files
210-
.idea
210+
.idea

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.13.0
11+
hooks:
12+
- id: ruff-check
13+
args: [ --fix ]
14+
- id: ruff-format

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# library-python
1+
# library-python

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ dependencies = [
2424
dev = [
2525
"pytest",
2626
"coverage",
27-
"pytest-cov"
27+
"pytest-cov",
28+
"pre-commit"
2829
]
2930

3031

3132
[project.urls]
3233
"Homepage" = "https://github.com/scadable/library-python"
33-
"Bug Tracker" = "https://github.com/scadable/library-python/issues"
34+
"Bug Tracker" = "https://github.com/scadable/library-python/issues"

src/scadable/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
print("Hello World")
1+
print("Hello World")

tests/test_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def test_module_import():
2-
import src.scadable
2+
import src.scadable # noqa

0 commit comments

Comments
 (0)