Repository navigation
Lint the Python code with ruff and check license headers - #22
Merged
Merged
Conversation
Check pyflakes and pycodestyle errors and warnings (E, F, W) with a line length of 120, like black. The rules are listed explicitly and CI pins the ruff version, so a new ruff release doesn't change what is checked. The code passes as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/check_license_headers.py checks that every tracked Python, VHDL and C source file has the MPL 2.0 notice and a copyright line ending with the current year, and the lint workflow runs it after ruff. The three files of the VHPI application still said 2014-2023. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds linting of the Python code with ruff, and a check of the license headers of all source files.
Ruff
F): unused imports and variables, undefined names and similar errors.E,W): including a line length of 120, the same as black's.The configuration is in
pyproject.toml. The rules are listed explicitly rather than taken from ruff's defaults, which change between releases. Ruff 0.17's defaults would also report 87 style findings (UP,SIM,C4, ...) in code that other open PRs change.License headers
tools/check_license_headers.pychecks every tracked.py,.vhd,.vhd.in,.cand.hfile for:Copyright (c) 2014-<year>, Lars Asplund lars.anders.asplund@gmail.comwithin the first 15 lines, with the current year as<year>, as in VUnit.It lists each file with what is missing or outdated. The three files of the VHPI application (
native/vhpi/) still said 2014-2023 and are updated here.The year check means every file has to be bumped at the start of each year, and the check fails until then.
CI
A new
lintworkflow runs both on every push and pull request:Locally
Tests
mainpasses ruff as it is, and the header check once the three VHPI headers are updated.F401), an undefined name (F821) and trailing whitespace (W291).🤖 Generated with Claude Code