Skip to content

Commit

Permalink
add ruff python linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Aug 17, 2023
1 parent 2737109 commit 993a537
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,15 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
env CTEST_OUTPUT_ON_FAILURE=1 ./build/test-target 5000000
lint-python:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Lint Python
run: |
python3 -m pip install ruff
ruff examples test
2 changes: 1 addition & 1 deletion examples/03_waypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[1.4, -1.6, 1.0],
[-0.6, -0.5, 0.4],
[-0.4, -0.35, 0.0],
[0.8, 1.8, -0.1]
[0.8, 1.8, -0.1],
]

inp.target_position = [0.5, 1, 0]
Expand Down
2 changes: 1 addition & 1 deletion examples/04_waypoints_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
[1.4, -1.6, 1.0],
[-0.6, -0.5, 0.4],
[-0.4, -0.35, 0.0],
[0.8, 1.8, -0.1]
[0.8, 1.8, -0.1],
]

inp.target_position = [0.5, 1, 0]
Expand Down
2 changes: 1 addition & 1 deletion examples/08_per_section_minimum_duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
[-0.4, -0.35, 0.0],
[-0.2, 0.35, -0.1],
[0.2, 0.5, -0.1],
[0.8, 1.8, -0.1]
[0.8, 1.8, -0.1],
]

inp.target_position = [0.5, 1.2, 0]
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[build-system]
requires = ["setuptools>=42", "wheel", "pybind11~=2.6.1", "ninja", "cmake>=3.10"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.ruff]
select = ["A", "COM", "E", "F", "G", "N", "PIE", "PTH", "PYI", "RSE", "RET", "SIM", "TCH", "W", "Q", "E201", "E202", "E203"]
line-length = 160
ignore = ["E402"]

[tool.ruff.flake8-quotes]
inline-quotes = "single"
multiline-quotes = "single"
2 changes: 1 addition & 1 deletion test/plot_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

path.insert(0, str(Path(__file__).parent.absolute().parent / 'build'))

from ruckig import InputParameter, OutputParameter, Result, Ruckig, Synchronization, ControlInterface, DurationDiscretization
from ruckig import InputParameter, OutputParameter, Result, Ruckig, Synchronization, ControlInterface, DurationDiscretization # noqa: F401


def walk_through_trajectory(otg, inp):
Expand Down
3 changes: 1 addition & 2 deletions test/plot_waypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
from sys import path

from plotter import Plotter
import numpy as np

path.insert(0, str(Path(__file__).parent.absolute().parent / 'build'))

from ruckig import InputParameter, OutputParameter, Result, Ruckig, Trajectory, ControlInterface
from ruckig import InputParameter, OutputParameter, Result, Ruckig, ControlInterface # noqa: F401


def walk_through_trajectory(otg, inp):
Expand Down

0 comments on commit 993a537

Please sign in to comment.