From 3e8626bfafa561510323bf8fe3963bc2860950ed Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 4 Aug 2021 17:40:39 +0200 Subject: [PATCH 1/4] tmtccmd update --- tmtccmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtccmd b/tmtccmd index dbf6034..9497851 160000 --- a/tmtccmd +++ b/tmtccmd @@ -1 +1 @@ -Subproject commit dbf6034513616e447cb980efe7cf0ac255c205a4 +Subproject commit 94978512deb6c91a6a1456ae3a1182bf679f063a From 6824e7d8c7f3cd2f0dfc7417628d0eedb89343b8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Aug 2021 11:31:08 +0200 Subject: [PATCH 2/4] made CLI and GUI executable --- tmtc_client_cli.py | 0 tmtc_client_gui.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tmtc_client_cli.py mode change 100644 => 100755 tmtc_client_gui.py diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py old mode 100644 new mode 100755 diff --git a/tmtc_client_gui.py b/tmtc_client_gui.py old mode 100644 new mode 100755 From 5ea6903881fc4d84b229ea3283cfeea7bf672e54 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Aug 2021 11:38:37 +0200 Subject: [PATCH 3/4] updated linter python script --- lint.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lint.py b/lint.py index f0f66f0..4a42485 100755 --- a/lint.py +++ b/lint.py @@ -4,11 +4,20 @@ import sys def main(): - status = os.system("flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics") + # Ignore folder created by venv + exclude_dirs_flag = '--exclude bin,lib' + additional_flags_both_steps = '--count --statistics' + additional_flags_first_step = '--select=E9,F63,F7,F82 --show-source' + flake8_first_step_cmd = \ + f'flake8 . {additional_flags_both_steps} {additional_flags_first_step} {exclude_dirs_flag}' + status = os.system(flake8_first_step_cmd) if os.WEXITSTATUS(status) != 0: print("Flake8 linter errors") sys.exit(0) - os.system("flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics") + flake8_second_step_cmd = \ + f'flake8 . {additional_flags_both_steps} --exit-zero --max-complexity=10 ' \ + f'--max-line-length=127 {exclude_dirs_flag}' + os.system(flake8_second_step_cmd) if __name__ == "__main__": From 7c598f26a83323a9d7eef2e5f804afc0080d1190 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 9 Aug 2021 11:45:01 +0200 Subject: [PATCH 4/4] instructions to run linter --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index c52a047..d0d50c4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,25 @@ # TMTC Commander EIVE +# Run Linter + +Can be used to quickly check validity of script. Install `flake8` first + +```sh +python3 -m pip install flake8 +``` + +or on Windows + +```sh +py -m pip install flake8 +``` + +and then run the `lint.py` script + +```sh +./lint.py +``` + # Set up virtual environment ## Linux