-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Developments in formatting, mostly (#50)
* Single project (#49) * Pre commit setup (#51) * Black for formatting (#54) --------- Signed-off-by: Christian Henkel <[email protected]>
- Loading branch information
Showing
236 changed files
with
3,832 additions
and
2,867 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
name: ${{ matrix.package }} ⏩ ${{ matrix.linter }} | ||
build: | ||
name: Pre-commit checks | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
linter: [ | ||
"pylint", | ||
"pycodestyle", | ||
"flake8", | ||
"mypy", | ||
"isort" | ||
] | ||
package: [ "jani_generator", "as2fm_common", "scxml_converter" ] | ||
# linter: [ | ||
# "pylint", | ||
# "pycodestyle", | ||
# "flake8", | ||
# "mypy", | ||
# "isort" | ||
# ] | ||
# package: [ | ||
# "as2fm_common", | ||
# "jani_generator", | ||
# "jani_visualizer", | ||
# "scxml_converter", | ||
# "trace_visualizer" | ||
# ] | ||
include: | ||
# (for humble): | ||
- python-version: "3.10" | ||
- python-version: "3.10" | ||
# os: "ubuntu-latest" | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -54,24 +60,24 @@ jobs: | |
pip install -e btlib/. | ||
- name: Install packages | ||
run: | | ||
pip install jani_generator/.[dev] | ||
pip install as2fm_common/.[dev] | ||
pip install scxml_converter/.[dev] | ||
- uses: marian-code/python-lint-annotate@v4 | ||
with: | ||
python-root-list: ${{ matrix.package }}/src/${{ matrix.package }} | ||
python-version: ${{ matrix.python-version }} | ||
use-pylint: ${{ matrix.linter == 'pylint' }} | ||
use-pycodestyle: ${{ matrix.linter == 'pycodestyle' }} | ||
use-flake8: ${{ matrix.linter == 'flake8' }} | ||
use-black: false | ||
use-mypy: ${{ matrix.linter == 'mypy' }} | ||
use-isort: ${{ matrix.linter == 'isort' }} | ||
use-vulture: false | ||
use-pydocstyle: false | ||
extra-pylint-options: "" | ||
extra-pycodestyle-options: "" | ||
extra-flake8-options: "--max-line-length=100" | ||
extra-black-options: "" | ||
extra-mypy-options: "--ignore-missing-imports" | ||
extra-isort-options: "" | ||
pip install . | ||
# - uses: marian-code/python-lint-annotate@v4 | ||
# with: | ||
# python-root-list: src/${{ matrix.package }} | ||
# python-version: ${{ matrix.python-version }} | ||
# use-pylint: ${{ matrix.linter == 'pylint' }} | ||
# use-pycodestyle: ${{ matrix.linter == 'pycodestyle' }} | ||
# use-flake8: ${{ matrix.linter == 'flake8' }} | ||
# use-black: false | ||
# use-mypy: ${{ matrix.linter == 'mypy' }} | ||
# use-isort: ${{ matrix.linter == 'isort' }} | ||
# use-vulture: false | ||
# use-pydocstyle: false | ||
# extra-pylint-options: "" | ||
# extra-pycodestyle-options: "" | ||
# extra-flake8-options: "--max-line-length=100" | ||
# extra-black-options: "" | ||
# extra-mypy-options: "--ignore-missing-imports" | ||
# extra-isort-options: "" | ||
- name: Pre-commit | ||
uses: pre-commit/[email protected] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,7 @@ on: | |
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
|
||
jobs: | ||
test: | ||
strategy: | ||
|
@@ -16,7 +15,7 @@ jobs: | |
os: ubuntu-24.04 | ||
- ros-distro: humble | ||
os: ubuntu-22.04 | ||
fail-fast: false | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Checkout the repository | ||
|
@@ -61,33 +60,28 @@ jobs: | |
echo SMC_STORM_PATH=$PWD/bin/ >> $GITHUB_OUTPUT | ||
# Update pip | ||
- name: Update pip | ||
run: python -m pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} --upgrade pip | ||
run: python -m pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} --upgrade pip | ||
# workaround python 3.12 issue | ||
- name: Install special fork of js2py | ||
run: | | ||
pip install --break-system-packages git+https://github.com/felixonmars/[email protected] | ||
if: ${{ matrix.os == 'ubuntu-24.04' }} | ||
# install the packages | ||
- name: Install packages | ||
run: | | ||
source colcon_ws/install/setup.bash # TODO: remove after the release of bt_tools | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} as2fm_common/.[dev] | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} jani_generator/.[dev] | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} scxml_converter/.[dev] | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} visualizers/jani_visualizer/.[dev] | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} visualizers/trace_visualizer/.[dev] | ||
run: | | ||
pip install ${{ matrix.os == 'ubuntu-24.04' && '--break-system-packages' || '' }} . | ||
# this solves | ||
# E ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject | ||
- name: Downgrade numpy, networkx to match | ||
run: | | ||
run: | | ||
pip install numpy==1.26.4 networkx==2.8.8 | ||
if: ${{ matrix.os == 'ubuntu-22.04' }} | ||
# lint packages | ||
# TODO: add linting | ||
# TODO: add linting | ||
# run the tests | ||
- name: Run tests | ||
run: | | ||
export PATH=$PATH:${{ steps.get_smc_storm.outputs.SMC_STORM_PATH }} | ||
# source /opt/ros/${{ matrix.ros-distro }}/setup.bash | ||
source colcon_ws/install/setup.bash # TODO: remove after the release of bt_tools | ||
pytest-3 -vs as2fm_common jani_generator scxml_converter visualizers/jani_visualizer visualizers/trace_visualizer | ||
pytest-3 -vs test/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.vscode | ||
*.egg-info/ | ||
*/build/ | ||
build/ | ||
*/*/build/ | ||
*.pyc | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
# black for auto-formatting | ||
- repo: https://github.com/psf/black | ||
rev: 24.8.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.10 | ||
# same as lint.yml | ||
# - repo: https://github.com/pycqa/pylint | ||
# rev: v3.3.1 | ||
# hooks: | ||
# - id: pylint | ||
# TODO: add pycodestyle | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.1.1 | ||
hooks: | ||
- id: flake8 | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v1.11.2 | ||
# hooks: | ||
# - id: mypy | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ Robert Bosch GmbH | |
Marco Lampacrescia <[email protected]> | ||
|
||
Robert Bosch GmbH | ||
Michaela Klauck <[email protected]> | ||
Michaela Klauck <[email protected]> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ pip install ../scxml_converter | |
pip install ../jani_generator | ||
pip install -r requirements.txt | ||
make html | ||
``` | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ sphinx==7.1.2 | |
sphinx-rtd-theme==1.3.0rc1 | ||
|
||
sphinx-autodoc2==0.5.0 | ||
myst-parser==2.0.0 | ||
myst-parser==2.0.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,4 @@ a:hover { | |
/* Visited links */ | ||
a:visited { | ||
color: var(--convince-orange); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ API | |
as2fm_common | ||
jani_generator | ||
scxml_converter | ||
|
Oops, something went wrong.