Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/lint-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Run Pre-Commit Hooks

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
6 changes: 3 additions & 3 deletions .github/workflows/test-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Scadable Tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
# push:
# branches:
# - main

jobs:
test:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ cython_debug/
.abstra/

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

Expand All @@ -207,4 +207,4 @@ marimo/_lsp/
__marimo__/

# Pycharm files
.idea
.idea
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# library-python
# library-python
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ dependencies = [
dev = [
"pytest",
"coverage",
"pytest-cov"
"pytest-cov",
"pre-commit"
]


[project.urls]
"Homepage" = "https://github.com/scadable/library-python"
"Bug Tracker" = "https://github.com/scadable/library-python/issues"
"Bug Tracker" = "https://github.com/scadable/library-python/issues"
2 changes: 1 addition & 1 deletion src/scadable/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print("Hello World")
print("Hello World")
2 changes: 1 addition & 1 deletion tests/test_import.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def test_module_import():
import src.scadable
import src.scadable # noqa
Loading