Skip to content

Commit 003e79f

Browse files
authored
Updating linters (#72)
* using pre-commit in ci Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * new pre-commit config Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * codespell Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * no flake8 Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * black, isort Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * pylint Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * new python versions Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> * making copyright files nor trigger linters Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com> --------- Signed-off-by: Christian Henkel <christian.henkel2@de.bosch.com>
1 parent 84540e2 commit 003e79f

File tree

81 files changed

+878
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+878
-845
lines changed

.github/workflows/lint.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,25 @@ on:
88
# Allows you to run this workflow manually from the Actions tab
99
workflow_dispatch:
1010
jobs:
11-
build:
11+
build:
1212
name: py${{ matrix.python-version }} @ ${{ matrix.os }}
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- python-version: "3.7"
18-
os: "ubuntu-20.04"
19-
- python-version: "3.7"
20-
os: "ubuntu-22.04"
21-
- python-version: "3.8"
22-
os: "ubuntu-20.04"
23-
- python-version: "3.8"
24-
os: "ubuntu-22.04"
17+
# versions updated according to
18+
# https://devguide.python.org/versions/
19+
# on 2025-01-15
2520
- python-version: "3.9"
2621
os: "ubuntu-22.04"
2722
- python-version: "3.10"
2823
os: "ubuntu-22.04"
24+
- python-version: "3.11"
25+
os: "ubuntu-22.04"
26+
- python-version: "3.12"
27+
os: "ubuntu-22.04"
28+
- python-version: "3.13"
29+
os: "ubuntu-22.04"
2930
runs-on: ${{ matrix.os }}
3031
concurrency:
3132
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
@@ -43,21 +44,8 @@ jobs:
4344
- name: Update pip
4445
run: |
4546
pip install --upgrade pip
46-
pip install setuptools_rust
47-
- name: Install dependencies
48-
run: pip install .
49-
- uses: ricardochaves/python-lint@v1.4.0
50-
with:
51-
python-root-list: "src/ test/"
52-
use-pylint: true
53-
use-pycodestyle: true
54-
use-flake8: true
55-
use-black: false
56-
use-mypy: true
57-
use-isort: true
58-
extra-pylint-options: ""
59-
extra-pycodestyle-options: ""
60-
extra-flake8-options: ""
61-
extra-black-options: ""
62-
extra-mypy-options: "--ignore-missing-imports"
63-
extra-isort-options: ""
47+
- name: Install packages
48+
run: |
49+
pip install .
50+
- name: Pre-commit
51+
uses: pre-commit/action@v3.0.1

.github/workflows/pytest.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
# versions updated accoring to
20+
# versions updated according to
2121
# https://devguide.python.org/versions/
22-
# on 2023-07-12
23-
- python-version: "3.8"
24-
os: "ubuntu-20.04"
25-
- python-version: "3.8"
26-
os: "ubuntu-22.04"
22+
# on 2025-01-15
2723
- python-version: "3.9"
2824
os: "ubuntu-22.04"
2925
- python-version: "3.10"
3026
os: "ubuntu-22.04"
3127
- python-version: "3.11"
3228
os: "ubuntu-22.04"
29+
- python-version: "3.12"
30+
os: "ubuntu-22.04"
31+
- python-version: "3.13"
32+
os: "ubuntu-22.04"
3333
runs-on: ${{ matrix.os }}
3434
concurrency:
3535
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ jobs:
88
fail-fast: true
99
matrix:
1010
include:
11-
# versions updated accoring to
11+
# versions updated according to
1212
# https://devguide.python.org/versions/
13-
# on 2023-07-12
14-
- python-version: "3.8"
15-
os: "ubuntu-20.04"
16-
- python-version: "3.8"
17-
os: "ubuntu-22.04"
13+
# on 2025-01-15
1814
- python-version: "3.9"
1915
os: "ubuntu-22.04"
2016
- python-version: "3.10"
2117
os: "ubuntu-22.04"
2218
- python-version: "3.11"
2319
os: "ubuntu-22.04"
20+
- python-version: "3.12"
21+
os: "ubuntu-22.04"
22+
- python-version: "3.13"
23+
os: "ubuntu-22.04"
2424
runs-on: ${{ matrix.os }}
2525
concurrency:
2626
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
@@ -74,4 +74,3 @@ jobs:
7474
user: __token__
7575
password: ${{ secrets.PYPI_TOKEN }}
7676
packages-dir: dist
77-

.github/workflows/todo-to-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ jobs:
88
steps:
99
- uses: "actions/checkout@v3"
1010
- name: "TODO to Issue"
11-
uses: "alstr/todo-to-issue-action@v4"
11+
uses: "alstr/todo-to-issue-action@v4"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ __pycache__/
55
build/
66
.coverage*
77
coverage.xml
8-
dist/
8+
dist/

.pre-commit-config.yaml

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
repos:
2-
- repo: local
3-
hooks:
4-
- id: pylint
5-
name: pylint
6-
entry: pylint
7-
language: system
8-
types: [ python ]
9-
files: ^(src/|test/)
10-
- id: pycodestyle
11-
name: pycodestyle
12-
entry: pycodestyle
13-
language: system
14-
types: [ python ]
15-
files: ^(src/|test/)
16-
- id: flake8
17-
name: flake8
18-
entry: flake8
19-
language: system
20-
types: [ python ]
21-
files: ^(src/|test/)
22-
- id: mypy
23-
name: mypy
24-
entry: mypy
25-
args:
26-
- "--ignore-missing-imports"
27-
language: system
28-
types: [ python ]
29-
files: ^(src/|test/)
30-
- id: isort
31-
name: isort
32-
entry: isort
33-
language: system
34-
types: [ python ]
35-
files: ^(src/|test/)
2+
# general
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: check-ast
8+
- id: check-builtin-literals
9+
- id: check-case-conflict
10+
- id: check-docstring-first
11+
- id: check-executables-have-shebangs
12+
- id: check-json
13+
- id: check-merge-conflict
14+
- id: check-symlinks
15+
- id: check-toml
16+
- id: check-vcs-permalinks
17+
- id: check-yaml
18+
- id: debug-statements
19+
- id: destroyed-symlinks
20+
- id: detect-private-key
21+
- id: end-of-file-fixer
22+
- id: fix-byte-order-marker
23+
- id: forbid-new-submodules
24+
- id: mixed-line-ending
25+
- id: name-tests-test
26+
- id: requirements-txt-fixer
27+
- id: sort-simple-yaml
28+
- id: trailing-whitespace
29+
# static analysis
30+
- repo: https://github.com/pycqa/pylint
31+
rev: v3.3.1
32+
hooks:
33+
- id: pylint
34+
# type checking
35+
- repo: https://github.com/pre-commit/mirrors-mypy
36+
rev: v1.11.2
37+
hooks:
38+
- id: mypy
39+
# spelling
40+
- repo: https://github.com/codespell-project/codespell
41+
rev: v2.3.0
42+
hooks:
43+
- id: codespell
44+
additional_dependencies:
45+
- tomli # required to read config from pyproject.toml
46+
# auto-formatting
47+
- repo: https://github.com/psf/black
48+
rev: 24.8.0
49+
hooks:
50+
- id: black
51+
language_version: python3.10
52+
# import sorting
53+
- repo: https://github.com/pycqa/isort
54+
rev: 5.13.2
55+
hooks:
56+
- id: isort

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Contributing
2-
Contributions to this are very welcome.
3-
We are especially interested in feedback on scan results that you got from a
2+
Contributions to this are very welcome.
3+
We are especially interested in feedback on scan results that you got from a
44
package, please make then a PR with:
55
* Package / Repo you are testing with commit hash
66
* Scan results you got (ideally with `-v`)
77
* What did not match you expectations?
88

9-
In terms of code changes, we follow the standard GitHub pull request model.
9+
In terms of code changes, we follow the standard GitHub pull request model.
1010
For large contributions we do encourage you to file a ticket in
1111
the GitHub issues tracking system prior to any code development to coordinate
1212
with the development team early in the process. Coordinating up

NOTICE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is the official list of ros_license_toolkit copyright holders and
1+
# This is the official list of ros_license_toolkit copyright holders and
22
# authors.
33
#
44
# Often employers or academic institutions have ownership over code that is
@@ -23,5 +23,3 @@
2323

2424
Robert Bosch GmbH
2525
Christian Henkel <christian.henkel2@de.bosch.com>
26-
27-

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/boschresearch/ros_license_toolkit/pytest.yml?label=pytest&style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/actions/workflows/pytest.yml)
44
[![github lint](https://img.shields.io/github/actions/workflow/status/boschresearch/ros_license_toolkit/lint.yml?label=lint&style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/actions/workflows/lint.yml)
5-
[![GitHub issues](https://img.shields.io/github/issues/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/issues)
6-
[![GitHub prs](https://img.shields.io/github/issues-pr/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/pulls)
5+
[![GitHub issues](https://img.shields.io/github/issues/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/issues)
6+
[![GitHub prs](https://img.shields.io/github/issues-pr/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/pulls)
77
[![PyPI](https://img.shields.io/pypi/v/ros_license_toolkit?style=flat-square)](https://pypi.org/project/ros-license-toolkit/)
8-
[![python](https://img.shields.io/github/languages/top/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/search?l=python)
8+
[![python](https://img.shields.io/github/languages/top/boschresearch/ros_license_toolkit.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/search?l=python)
99
[![License](https://img.shields.io/badge/license-Apache%202-blue.svg?style=flat-square)](https://github.com/boschresearch/ros_license_toolkit/blob/main/LICENSE)
1010

1111
> **Warning**
@@ -24,7 +24,7 @@ ROS packages must have licenses. This tool checks if the license declarations in
2424
```mermaid
2525
graph TD
2626
classDef stroke stroke:#333,stroke-width:2px;
27-
s([scan code for licenses and copyrights])
27+
s([scan code for licenses and copyrights])
2828
class s stroke
2929
p[compare to\n package.xml\nfor linting]
3030
class p stroke
@@ -94,8 +94,8 @@ options:
9494
```
9595

9696
Additionally, there is an option to ignore single files, folders and types of files.
97-
If there exists a `.scanignore` in the **top level directory** of a package,
98-
everything in it is going to be ignored.
97+
If there exists a `.scanignore` in the **top level directory** of a package,
98+
everything in it is going to be ignored.
9999
The file entries work similar to a `.gitignore` file, including making comments with `#`.
100100
One Example for a custom `.scanignore` file:
101101

0 commit comments

Comments
 (0)