Skip to content

Commit 8dc39e6

Browse files
authored
Merge pull request #107 from tekktrik/dev/updates
General updates
2 parents b141295 + ee184b4 commit 8dc39e6

File tree

11 files changed

+45
-67
lines changed

11 files changed

+45
-67
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: 2024 Alec Delaney
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "pip"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
11+
reviewers: ["tekktrik"]
12+
versioning-strategy: increase

.pre-commit-config.yaml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,11 @@ repos:
3030
name: Fix end of files
3131
- id: trailing-whitespace
3232
name: Trim trailing whitespace
33-
- repo: https://github.com/PyCQA/isort
34-
rev: 5.13.2
35-
hooks:
36-
- id: isort
37-
name: Sort imports
38-
args:
39-
- --multi-line
40-
- VERTICAL_HANGING_INDENT
41-
- --tc
42-
- repo: https://github.com/psf/black
43-
rev: 23.1.0
44-
hooks:
45-
- id: black
46-
name: Format via black
47-
- repo: https://github.com/asottile/pyupgrade
48-
rev: v3.15.0
49-
hooks:
50-
- id: pyupgrade
51-
name: Upgrade python syntax
52-
args:
53-
- --py38-plus
54-
- repo: https://github.com/PyCQA/pydocstyle
55-
rev: 6.3.0
56-
hooks:
57-
- id: pydocstyle
58-
name: Check docstrings compliance
59-
- repo: https://github.com/PyCQA/pylint
60-
rev: v3.0.3
61-
hooks:
62-
- id: pylint
63-
name: Lint via pylint
64-
types: [python]
65-
exclude: "^(docs/conf.py)"
33+
- repo: https://github.com/astral-sh/ruff-pre-commit
34+
rev: v0.1.11
35+
hooks:
36+
- id: ruff-format
37+
name: Format via ruff
38+
- id: ruff
39+
name: Check via ruff
40+
args: [--fix]

circlink/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
The main script handling CLI interactions for ``circlink``.
5+
"""The main script handling CLI interactions for ``circlink``.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""

circlink/backend.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
Backend operations for circlink.
5+
"""Backend operations for circlink.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""
@@ -23,8 +22,7 @@
2322
import circlink.link
2423

2524

26-
# pylint: disable=too-many-locals,too-many-branches,too-many-arguments
27-
def start_backend(
25+
def start_backend( # noqa: PLR0913, PLR0912
2826
read_path: str,
2927
write_path: str,
3028
base_dir: str,

circlink/cli/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
The main script handling CLI interactions for ``circlink``.
5+
"""The main script handling CLI interactions for ``circlink``.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""
@@ -37,9 +36,8 @@
3736
app.add_typer(workspace.workspace_app, name="workspace")
3837

3938

40-
# pylint: disable=too-many-arguments
4139
@app.command()
42-
def start(
40+
def start( # noqa: PLR0913
4341
read_path: str = Argument(..., help="The read path/pattern of file(s) to save"),
4442
write_path: str = Argument(
4543
...,
@@ -282,8 +280,7 @@ def callback(
282280

283281

284282
def reset_cb() -> None:
285-
"""
286-
Reset the app directory.
283+
"""Reset the app directory.
287284
288285
Useful if you upgrade circlink and there are breaking changes.
289286
"""

circlink/cli/config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
The sub-script for handling the config options for ``circlink``.
5+
"""The sub-script for handling the config options for ``circlink``.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""
@@ -42,7 +41,7 @@ def callback(
4241

4342
@config_app.command()
4443
def view(
45-
config_path: str = Argument("all", help="The setting to view, using dot notation")
44+
config_path: str = Argument("all", help="The setting to view, using dot notation"),
4645
) -> None:
4746
"""View a config setting for circlink."""
4847
# Get the settings, show all settings if no specific on is specified

circlink/cli/workspace.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
The sub-script for handling the workspace options for ``circlink``.
5+
"""The sub-script for handling the workspace options for ``circlink``.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""

circlink/ledger.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
Information and methods pertaining to the ledger file.
5+
"""Information and methods pertaining to the ledger file.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""
@@ -21,8 +20,7 @@
2120

2221

2322
def with_ledger(mode: str = "a"):
24-
"""
25-
Use the ledger file.
23+
"""Use the ledger file.
2624
2725
Manages locking and unlocking the file
2826
"""
@@ -65,8 +63,7 @@ def wrapper_with_ledger(
6563

6664
@with_ledger(mode="a")
6765
def append_to_ledger(entry: LedgerEntry, **args) -> Literal[True]:
68-
"""
69-
Add a file to the ledger.
66+
"""Add a file to the ledger.
7067
7168
Returns whether the file actually was added (True) or if it already
7269
existed (False).
@@ -78,8 +75,7 @@ def append_to_ledger(entry: LedgerEntry, **args) -> Literal[True]:
7875

7976
@with_ledger(mode="w")
8077
def remove_from_ledger(entry: LedgerEntry, **args) -> Literal[True]:
81-
"""
82-
Remove a file from the ledger.
78+
"""Remove a file from the ledger.
8379
8480
Returns whether the file actually was removed (True) or if it didn't
8581
exist (False).

circlink/link.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
"""
6-
Information and methods pertaining to links and link files.
5+
"""Information and methods pertaining to links and link files.
76
87
Author(s): Alec Delaney (Tekktrik)
98
"""
@@ -31,8 +30,7 @@
3130
class CircuitPythonLink:
3231
"""The link to the device."""
3332

34-
# pylint: disable=too-many-arguments
35-
def __init__(
33+
def __init__( # noqa: PLR0913
3634
self,
3735
read_path: str,
3836
write_path: str,
@@ -216,8 +214,7 @@ def get_files_monitored(self):
216214

217215
return [file for file in all_potential if file.is_file()]
218216

219-
# pylint: disable=too-many-branches
220-
def begin_monitoring(self) -> None:
217+
def begin_monitoring(self) -> None: # noqa: PLR0912
221218
"""Monitor the listed file(s) for changes."""
222219
# Ensure the write path exists
223220
os.makedirs(self._write_path, exist_ok=True)

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ classifiers = [
3737
"Programming Language :: Python :: 3.8",
3838
"Programming Language :: Python :: 3.9",
3939
"Programming Language :: Python :: 3.10",
40+
"Programming Language :: Python :: 3.11",
41+
"Programming Language :: Python :: 3.12",
4042
"Operating System :: Unix",
4143
]
4244
dynamic = ["dependencies", "optional-dependencies"]
@@ -54,3 +56,7 @@ templates = ["*.yaml"]
5456
[tool.setuptools.dynamic]
5557
dependencies = {file = ["requirements.txt"]}
5658
optional-dependencies = {dev = {file = ["requirements-dev.txt"]}}
59+
60+
[tool.ruff.lint]
61+
select = ["D", "PL", "UP", "I"]
62+
ignore = ["D213", "D203"]

0 commit comments

Comments
 (0)