diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..9b0d3a7 --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +extend-ignore = B902,C816,D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404,I202,Q000 +import-order-style = google +max-line-length = 125 +show-source = true +statistics = true \ No newline at end of file diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index cb7daeb..8bea564 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -30,7 +30,7 @@ jobs: distribution: humble linter: flake8 package-name: "*" - arguments: '--config=${{ github.workspace }}/object_detection/setup.cfg' + arguments: '--config=${{ github.workspace }}/.flake8' - name: Ament PEP257 Lint uses: ros-tooling/action-ros-lint@master with: diff --git a/object_detection/object_detection/DetectorBase.py b/object_detection/object_detection/DetectorBase.py index 8521a93..d0b11f5 100644 --- a/object_detection/object_detection/DetectorBase.py +++ b/object_detection/object_detection/DetectorBase.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np - from abc import ABC, abstractmethod +import numpy as np + class DetectorBase(ABC): diff --git a/object_detection/object_detection/Detectors/YOLOv8.py b/object_detection/object_detection/Detectors/YOLOv8.py index 70fc715..9bb1918 100755 --- a/object_detection/object_detection/Detectors/YOLOv8.py +++ b/object_detection/object_detection/Detectors/YOLOv8.py @@ -15,6 +15,7 @@ import os from ultralytics import YOLO + from ..DetectorBase import DetectorBase diff --git a/object_detection/setup.py b/object_detection/setup.py index c1ea485..c1fcbea 100644 --- a/object_detection/setup.py +++ b/object_detection/setup.py @@ -1,6 +1,5 @@ -import os - from glob import glob +import os from setuptools import setup diff --git a/object_detection/test/test_flake8.py b/object_detection/test/test_flake8.py index 602db20..7932fbd 100644 --- a/object_detection/test/test_flake8.py +++ b/object_detection/test/test_flake8.py @@ -21,7 +21,7 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8(): - config_file = join(dirname(dirname(abspath(__file__))), "setup.cfg") + config_file = join(dirname(dirname(dirname(abspath(__file__)))), ".flake8") args = [ "--config={}".format(config_file) ]