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
502 changes: 0 additions & 502 deletions .pylintrc

This file was deleted.

38 changes: 0 additions & 38 deletions .run/commands/pylint.sh

This file was deleted.

9 changes: 9 additions & 0 deletions .run/commands/ruffautofix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# vim: set ft=bash ts=3 sw=3 expandtab:
# Run the Ruff linter, applying automatic fixes only

command_ruffautofix() {
echo "Applying Ruff automatic fixes..."
CLICOLOR_FORCE=1 poetry_run ruff check --fix --fix-only
echo "done"
}

2 changes: 1 addition & 1 deletion .run/commands/ruffformat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

command_ruffformat() {
echo "Running Ruff formatter..."
poetry_run ruff format "$@"
CLICOLOR_FORCE=1 poetry_run ruff format "$@"
echo "done"
}

33 changes: 33 additions & 0 deletions .run/commands/rufflint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# vim: set ft=bash ts=3 sw=3 expandtab:
# Run the Ruff linter with no automatic fixes

# The command line below is a bit of a hack. The goal is to generate output
# that's compatible with the PyCharm output filter, which expects this:
#
# $FILE_PATH$:$LINE$
#
# However, right now ruff generates some extra stuff at the front of the line,
# (" --> "), which needs to be stripped so PyCharm will recognize the pattern.
# In theory it seems like it should be possible to do this entirely within the
# PyCharm output filter, without needing sed, but I haven't been able to make
# it work.
#
# Note that the extra .* in the regex below is needed to handle the ANSI color
# escape sequences, which aren't immediately obvious.
#
# See: https://github.com/astral-sh/ruff/issues/19983

command_rufflint() {
echo "Running Ruff linter..."

# normally we would just run the command, but the $() subshell messes with error handling
OUTPUT=$(CLICOLOR_FORCE=1 poetry_run ruff check --no-fix 2>&1)
if [ $? != 0 ]; then
echo "$OUTPUT" | sed 's/ *.*-->.* //'
exit 1
fi

echo "$OUTPUT"
echo "done"
}

4 changes: 2 additions & 2 deletions .run/tasks/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ task_checks() {
echo ""
run_command ruffformat --check
echo ""
run_command mypy
run_command rufflint
echo ""
run_command pylint
run_command mypy
}

1 change: 1 addition & 0 deletions .run/tasks/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ help_format() {

task_format() {
run_command ruffformat
run_command ruffautofix
}

6 changes: 3 additions & 3 deletions .run/tasks/pylint.sh → .run/tasks/lint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# vim: set ft=bash sw=3 ts=3 expandtab:

help_pylint() {
help_lint() {
# No help - exists for PyCharm integration
echo -n ""
}

task_pylint() {
run_command pylint
task_lint() {
run_command rufflint
}

2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Version 0.1.27 unreleased
* Add a new `run clean` target to clean up generated data.
* Move unit tests from `tests` into `src/tests/uciparse`.
* Update the MyPy configuration so we're using latest rules.
* Replace black and isort tools with the Ruff formatter.
* Replace black, isort, and pylint with the Ruff formatter and linter.
* Update the jinja2 transitive dependency to address CVE-2025-27516.
* Update the requests transitive dependency to address CVE-2024-47081.
* Update the urllib3 transitive dependency to address CVE-2025-50181.
Expand Down
36 changes: 18 additions & 18 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This code should work equivalently on MacOS, Linux, and Windows.

This project uses [Poetry v2](https://python-poetry.org/) to manage Python packaging and dependencies. Most day-to-day tasks (such as running unit tests from the command line) are orchestrated through Poetry.

A coding standard is enforced using [Ruff](https://docs.astral.sh/ruff/) and [Pylint](https://pypi.org/project/pylint/). Python 3 type hinting is validated using [MyPy](https://pypi.org/project/mypy/).
A coding standard is enforced using [Ruff](https://docs.astral.sh/ruff/). Python 3 type hinting is validated using [MyPy](https://pypi.org/project/mypy/).

## Pre-Commit Hooks

Expand Down Expand Up @@ -187,7 +187,7 @@ Go to the PyCharm settings and find the `uci-parse` project. Under
folder. In the **Exclude Files** box, enter the following:

```
LICENSE;NOTICE;PyPI.md;build;dist;docs/_build;out;poetry.lock;poetry.toml;run;.coverage;.coverage.lcov;.coveragerc;.gitattributes;.github;.gitignore;.htmlcov;.idea;.mypy_cache;.poetry;.pre-commit-config.yaml;.pylintrc;.pytest_cache;.python-version;.readthedocs.yml;.run;.tabignore;.venv
LICENSE;NOTICE;PyPI.md;build;dist;docs/_build;out;poetry.lock;poetry.toml;run;.coverage;.coverage.lcov;.coveragerc;.gitattributes;.github;.gitignore;.htmlcov;.idea;.mypy_cache;.poetry;.pre-commit-config.yaml;.pytest_cache;.python-version;.readthedocs.yml;.ruff_cache;.run;.tabignore;.venv
```

When you're done, click **Ok**. Then, go to the gear icon in the project panel
Expand Down Expand Up @@ -217,11 +217,11 @@ run configuration before PyCharm will find the right test suite.
### External Tools

Optionally, you might want to set up external tools for some of common
developer tasks: code reformatting and the PyLint and MyPy checks. One nice
developer tasks: code reformatting and the Ruff and MyPy checks. One nice
advantage of doing this is that you can configure an output filter, which makes
the Pylint and MyPy errors clickable. To set up external tools, go to PyCharm
settings and find **Tools > External Tools**. Add the tools as described
below.
the Ruff linter and MyPy errors clickable. To set up external tools, go to
PyCharm settings and find **Tools > External Tools**. Add the tools as
described below.

#### Linux or MacOS

Expand Down Expand Up @@ -272,23 +272,23 @@ source ~/.bash_profile
|Open console for tool outout|_Checked_|
|Make console active on message in stdout|_Checked_|
|Make console active on message in stderr|_Checked_|
|Output filters|`$FILE_PATH$:$LINE$:$COLUMN$:.*`|
|Output filters|`$FILE_PATH$:$LINE$`|

##### Run Pylint Checks
##### Run Ruff Linter

|Field|Value|
|-----|-----|
|Name|`Run Pylint Checks`|
|Description|`Run the Pylint code checks`|
|Name|`Run Ruff Linter`|
|Description|`Run the Ruff linter code checks`|
|Group|`Developer Tools`|
|Program|`$ProjectFileDir$/run`|
|Arguments|`pylint`|
|Arguments|`lint`|
|Working directory|`$ProjectFileDir$`|
|Synchronize files after execution|_Unchecked_|
|Open console for tool outout|_Checked_|
|Make console active on message in stdout|_Checked_|
|Make console active on message in stderr|_Checked_|
|Output filters|`$FILE_PATH$:$LINE$:$COLUMN.*`|
|Output filters|`$FILE_PATH$:$LINE$`|

#### Windows

Expand Down Expand Up @@ -328,23 +328,23 @@ change the path for `bash.exe`.
|Open console for tool outout|_Checked_|
|Make console active on message in stdout|_Checked_|
|Make console active on message in stderr|_Checked_|
|Output filters|`$FILE_PATH$:$LINE$:$COLUMN$:.*`|
|Output filters|`$FILE_PATH$:$LINE$`|

##### Run Pylint Checks
##### Run Ruff Linter

|Field|Value|
|-----|-----|
|Name|`Run Pylint Checks`|
|Description|`Run the Pylint code checks`|
|Name|`Run Ruff Linter`|
|Description|`Run the Ruff linter code checks`|
|Group|`Developer Tools`|
|Program|`powershell.exe`|
|Arguments|`& 'C:\Program Files\Git\bin\bash.exe' -l "./run" pylint | Out-String`|
|Arguments|`& 'C:\Program Files\Git\bin\bash.exe' -l "./run" lint | Out-String`|
|Working directory|`$ProjectFileDir$`|
|Synchronize files after execution|_Unchecked_|
|Open console for tool outout|_Checked_|
|Make console active on message in stdout|_Checked_|
|Make console active on message in stderr|_Checked_|
|Output filters|`$FILE_PATH$:$LINE$:$COLUMN.*`|
|Output filters|`$FILE_PATH$:$LINE$`|

## Release Process

Expand Down
3 changes: 0 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
# pylint: skip-file
#
# UCI Parse documentation build configuration file, based on existing
# documentation for Requests (https://github.com/psf/requests).
#
Expand Down
93 changes: 4 additions & 89 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading