From bf68eeb596f873f3e6ab497ea42a079c98835f97 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 16 Aug 2024 23:57:42 -0700 Subject: [PATCH] remove import linter (#33319) * rm import linter, we're done! * revert * uv lock * Revert "uv lock" This reverts commit 5e46f48e8a5738ea5121da6f2d1c7210dcefe053. --- .importlinter | 63 -------------------------------------------- pyproject.toml | 1 - scripts/lint/lint.sh | 2 -- 3 files changed, 66 deletions(-) delete mode 100644 .importlinter diff --git a/.importlinter b/.importlinter deleted file mode 100644 index 79f541ccb38578..00000000000000 --- a/.importlinter +++ /dev/null @@ -1,63 +0,0 @@ -[importlinter] -root_packages = - openpilot - cereal - capnp - -[importlinter:contract:1] -name = Forbid imports from openpilot.selfdrive.car to openpilot.system -type = forbidden -source_modules = - openpilot.selfdrive.car -forbidden_modules = - cereal - capnp - openpilot.common - openpilot.selfdrive.controls - openpilot.selfdrive.debug - openpilot.selfdrive.pandad - openpilot.selfdrive.test - openpilot.system - openpilot.body - openpilot.tools - openpilot.docs - openpilot.msgq - openpilot.panda - openpilot.rednose - openpilot.release - openpilot.teleoprtc - openpilot.tinygrad -ignore_imports = - # these are okay - openpilot.selfdrive.car.card -> openpilot.common.swaglog - openpilot.selfdrive.car.card -> openpilot.common.realtime - openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events - openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.logreader - openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.car.card - openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.route - openpilot.selfdrive.car.tests.test_models -> openpilot.system.hardware.hw - openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_angle - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.longcontrol - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_torque - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_pid - openpilot.selfdrive.car.card -> openpilot.common.params - openpilot.selfdrive.car.tests.test_models -> openpilot.common.params - openpilot.selfdrive.car.tests.test_models -> openpilot.common.basedir - openpilot.selfdrive.car.card -> openpilot.selfdrive.pandad - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.pandad - openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.pandad - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.test.fuzzy_generation - openpilot.selfdrive.car.tests.test_models -> capnp - openpilot.selfdrive.car.tests.test_car_interfaces -> cereal - openpilot.selfdrive.car.tests.test_car_interfaces -> cereal.messaging - openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.test.fuzzy_generation - openpilot.selfdrive.car.tests.test_models -> cereal - openpilot.selfdrive.car.tests.test_models -> cereal.messaging - openpilot.selfdrive.car.card -> cereal - openpilot.selfdrive.car.card -> cereal.messaging - openpilot.selfdrive.car.car_specific -> openpilot.selfdrive.controls.lib.events - openpilot.selfdrive.car.car_specific -> cereal - openpilot.selfdrive.car.car_specific -> cereal.messaging - openpilot.selfdrive.car.card -> capnp -unmatched_ignore_imports_alerting = warn diff --git a/pyproject.toml b/pyproject.toml index 9eee3afcc54b1b..df6ba3f7ccbcd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,6 @@ docs = [ testing = [ "coverage", "hypothesis ==6.47.*", - "import-linter", "mypy", "pytest", "pytest-cov", diff --git a/scripts/lint/lint.sh b/scripts/lint/lint.sh index 13f3fe133c2ccb..652fa4d65ff622 100755 --- a/scripts/lint/lint.sh +++ b/scripts/lint/lint.sh @@ -48,7 +48,6 @@ function run_tests() { PYTHON_FILES=$2 run "ruff" ruff check $PYTHON_FILES --quiet - run "lint-imports" lint-imports run "check_added_large_files" python3 -m pre_commit_hooks.check_added_large_files --enforce-all $ALL_FILES --maxkb=120 run "check_shebang_scripts_are_executable" python3 -m pre_commit_hooks.check_shebang_scripts_are_executable $ALL_FILES run "check_shebang_format" $DIR/check_shebang_format.sh $ALL_FILES @@ -69,7 +68,6 @@ function help() { echo -e "${BOLD}${UNDERLINE}Tests:${NC}" echo -e " ${BOLD}ruff${NC}" echo -e " ${BOLD}mypy${NC}" - echo -e " ${BOLD}lint-imports${NC}" echo -e " ${BOLD}codespell${NC}" echo -e " ${BOLD}check_added_large_files${NC}" echo -e " ${BOLD}check_shebang_scripts_are_executable${NC}"