From 7d0ff139a61692dd15fa418ba290177d95541efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Thu, 29 Feb 2024 13:32:35 +0100 Subject: [PATCH 1/2] Try to find an flake8 config file in the local package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- ament_flake8/ament_flake8/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ament_flake8/ament_flake8/main.py b/ament_flake8/ament_flake8/main.py index ed22bdde..f0838132 100755 --- a/ament_flake8/ament_flake8/main.py +++ b/ament_flake8/ament_flake8/main.py @@ -34,6 +34,10 @@ def main(argv=sys.argv[1:]): def main_with_errors(argv=sys.argv[1:]): config_file = os.path.join( + os.getcwd(), 'test', 'configuration', 'ament_flake8.ini') + + if not os.path.isfile(config_file): + config_file = os.path.join( os.path.dirname(__file__), 'configuration', 'ament_flake8.ini') parser = argparse.ArgumentParser( From afb8b316080daecee0dee11951fa9ecbfe91324e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Tue, 5 Mar 2024 15:30:52 +0100 Subject: [PATCH 2/2] make linters happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- ament_flake8/ament_flake8/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ament_flake8/ament_flake8/main.py b/ament_flake8/ament_flake8/main.py index f0838132..f9fe56f4 100755 --- a/ament_flake8/ament_flake8/main.py +++ b/ament_flake8/ament_flake8/main.py @@ -37,8 +37,8 @@ def main_with_errors(argv=sys.argv[1:]): os.getcwd(), 'test', 'configuration', 'ament_flake8.ini') if not os.path.isfile(config_file): - config_file = os.path.join( - os.path.dirname(__file__), 'configuration', 'ament_flake8.ini') + config_file = os.path.join( + os.path.dirname(__file__), 'configuration', 'ament_flake8.ini') parser = argparse.ArgumentParser( description='Check code using flake8.',