Skip to content

Commit 6a56340

Browse files
committed
Small linter cleanup
1 parent b88a941 commit 6a56340

File tree

4 files changed

+42
-41
lines changed

4 files changed

+42
-41
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Check http://editorconfig.org for more information
1+
# Check https://editorconfig.org for more information
22
# This is the main config file for this project:
33
root = true
44

.github/workflows/main.yaml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ name: Build and test linkml-runtime
88
on:
99
push:
1010
branches:
11-
- main
11+
- main
1212
pull_request:
1313
workflow_dispatch:
1414

1515
jobs:
16-
1716
quality-checks:
1817
runs-on: ubuntu-latest
1918
steps:
20-
- uses: actions/checkout@v4.2.2
19+
- uses: actions/checkout@4.2.2
2120
- name: Install Poetry
2221
run: |
2322
pipx install poetry
@@ -42,61 +41,49 @@ jobs:
4241
matrix:
4342
os: [ubuntu-latest, windows-latest]
4443
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
44+
# Test on Windows with only the oldest and newest Python versions
4545
exclude:
46-
- os: windows-latest
47-
python-version: "3.10"
48-
- os: windows-latest
49-
python-version: "3.11"
50-
- os: windows-latest
51-
python-version: "3.12"
46+
- os: windows-latest
47+
python-version: "3.10"
48+
- os: windows-latest
49+
python-version: "3.11"
50+
- os: windows-latest
51+
python-version: "3.12"
52+
# See https://github.com/snok/install-poetry#running-on-windows
53+
defaults:
54+
run:
55+
shell: bash
5256

5357
runs-on: ${{ matrix.os }}
5458

5559
steps:
60+
- name: Check out repository
61+
uses: actions/checkout@4.2.2
62+
with:
63+
fetch-depth: 0
64+
5665

57-
#----------------------------------------------
58-
# install poetry
59-
#----------------------------------------------
6066
- name: Install Poetry
6167
run: |
6268
pipx install poetry
6369
pipx inject poetry poetry-dynamic-versioning
6470
65-
#----------------------------------------------
66-
# check-out repo and set-up python
67-
#----------------------------------------------
68-
- name: Check out repository
69-
uses: actions/checkout@v4.2.2
70-
with:
71-
fetch-depth: 0
72-
7371
- name: Set up Python ${{ matrix.python-version }}
7472
uses: actions/setup-python@v5.6.0
7573
with:
7674
python-version: ${{ matrix.python-version }}
7775
cache: 'poetry'
7876

79-
#----------------------------------------------
80-
# install your root project, if required
81-
#----------------------------------------------
8277
- name: Install library
8378
run: |
8479
poetry install --no-interaction
85-
86-
#----------------------------------------------
87-
# coverage report
88-
#----------------------------------------------
8980
- name: Generate coverage results
9081
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
9182
shell: bash
9283
run: |
9384
poetry run coverage run -m pytest
9485
poetry run coverage xml
9586
poetry run coverage report -m
96-
97-
#----------------------------------------------
98-
# upload coverage results
99-
#----------------------------------------------
10087
- name: Upload coverage report
10188
uses: codecov/codecov-action@v5
10289
with:

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ repos:
99
- id: end-of-file-fixer
1010
exclude: __snapshots__
1111
- id: check-yaml
12-
exclude: (__snapshots__|test_utils/input)
1312
- id: check-toml
1413
- id: trailing-whitespace
15-
# TODO: This is temporary while bioliank is being fixed upstream.
16-
# TODO: Should look at snapshot exclusion to find upstream problems
17-
exclude: (__snapshots__|biolink-model.yaml)
1814
- repo: https://github.com/astral-sh/ruff-pre-commit
1915
# Ensure this version stays in sync with tox.ini
2016
rev: v0.11.13

pyproject.toml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ style = "pep440"
7575
coverage = "^6.2"
7676
requests-cache = "^1.2.0"
7777

78+
79+
[tool.codespell]
80+
skip = [
81+
".git", "*.pdf", "*.svg", "*.dill",
82+
"poetry.lock",
83+
]
84+
# Ignore table where words could be split across rows
85+
ignore-regex = '(\|.*\|.*\|.*\||\[[A-Z][a-z]\][a-z][a-z])'
86+
ignore-words-list = [
87+
]
88+
quiet-level = 3
7889
# https://docs.astral.sh/ruff/settings/
7990
[tool.ruff]
8091
extend-exclude = []
@@ -86,12 +97,11 @@ target-version = "py39"
8697
[tool.ruff.lint]
8798

8899
select = [
89-
# core
90-
"F", # Pyflakes
91-
"E", # pycodestyle errors
100+
"E", # pycodestyle errors
101+
"F", # Pyflakes
102+
"I", # isort
92103
"W", # pycodestyle warnings
93104
"C90", # mccabe +
94-
"I", # isort
95105
"N", # pep8-naming
96106
# "D", # pydocstyle
97107
"UP", # pyupgrade
@@ -177,6 +187,14 @@ max-complexity = 15
177187
requires = ["tox>=4"]
178188
env_list = ["lint", "py{39,310,311,312,313}"]
179189

190+
[tool.tox.env_run_base]
191+
allowlist_externals = ["poetry"]
192+
deps = ["pytest"]
193+
commands = [
194+
["poetry", "install", "--no-root", "--sync", "--all-extras"],
195+
["poetry", "run", "pytest", "{posargs}"],
196+
]
197+
180198
[tool.tox.env.codespell]
181199
description = "Run spell checkers."
182200
skip_install = true
@@ -205,7 +223,7 @@ commands = [
205223
]
206224

207225
[tool.tox.env.lint]
208-
description = "Run code linter (no fixes)."
226+
description = "Run code linter and formatter (no fixes)."
209227
skip_install = true
210228
deps = ["ruff==0.11.13"]
211229
commands = [

0 commit comments

Comments
 (0)