From efe2e99c275d1129e946192f52edb7e414b57943 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:11:38 +0200 Subject: [PATCH 1/7] requirement.txt, not requirements.txt Normally the filename is plural, not singular. --- .github/workflows/lint_python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 6557c0e..4ae1bf8 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 - run: pip install --upgrade pip wheel - run: pip install bandit black codespell flake8 flake8-bugbear flake8-return flake8-comprehensions isort mypy pytest pyupgrade safety @@ -15,7 +15,7 @@ jobs: - run: flake8 --ignore=E124,E128,E225,E251,E302,R502,R503,W291,W293,W605 --max-complexity=11 --max-line-length=265 --show-source --statistics . - run: isort --check-only --profile black . || true - - run: pip install -r requirements.txt || pip install --editable . || pip install . || true + - run: pip install -r requirement.txt || pip install -r requirements.txt || pip install --editable . || pip install . || true - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . || true - run: pytest . || true From a3d52afc84c37e2817e7848b1d4112474b8bfd2b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:14:51 +0200 Subject: [PATCH 2/7] Update lint_python.yml --- .github/workflows/lint_python.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 4ae1bf8..eee4a73 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -6,6 +6,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 + with: + python-version: '3.x' - run: pip install --upgrade pip wheel - run: pip install bandit black codespell flake8 flake8-bugbear flake8-return flake8-comprehensions isort mypy pytest pyupgrade safety From a8291d2bacca51715d3268d8bb491c0b22ae749f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:21:47 +0200 Subject: [PATCH 3/7] Update generate_readme.py --- generate_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_readme.py b/generate_readme.py index 5990fd2..1b90a03 100644 --- a/generate_readme.py +++ b/generate_readme.py @@ -3,7 +3,7 @@ import re from core import HackingTool from core import HackingToolsCollection -from main import all_tools +from hackingtool import all_tools def sanitize_anchor(s): From a62716c5a48af6526fa5bd045f5f24ae718258a5 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:26:49 +0200 Subject: [PATCH 4/7] Fix two mypy issues --- hackingtool.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hackingtool.py b/hackingtool.py index 7514d80..619bf18 100644 --- a/hackingtool.py +++ b/hackingtool.py @@ -105,13 +105,14 @@ if __name__ == "__main__": if not os.path.exists(archive): os.mkdir(archive) os.chdir(archive) - all_tools = AllTools() - all_tools.show_options() + AllTools().show_options() # If not Linux and probably Windows elif system() == "Windows": print( - "\033[91m Please Run This Tool On A Debian System For Best Results " "\e[00m") + "\033[91m Please Run This Tool On A Debian System For Best Results " + r"\e[00m" + ) sleep(2) webbrowser.open_new_tab("https://tinyurl.com/y522modc") From 920a43ee38158c87a7ec14ef6a057e0911d40a85 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:32:11 +0200 Subject: [PATCH 5/7] Update hackingtool.py --- hackingtool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hackingtool.py b/hackingtool.py index 619bf18..00f6ef7 100644 --- a/hackingtool.py +++ b/hackingtool.py @@ -110,8 +110,7 @@ if __name__ == "__main__": # If not Linux and probably Windows elif system() == "Windows": print( - "\033[91m Please Run This Tool On A Debian System For Best Results " - r"\e[00m" + r"\033[91m Please Run This Tool On A Debian System For Best Results\e[00m" ) sleep(2) webbrowser.open_new_tab("https://tinyurl.com/y522modc") From 16ccd5066d9fc1add4694d491cbad6e94ef9f30f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:37:12 +0200 Subject: [PATCH 6/7] Fix mypy issue --- tools/forensic_tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/forensic_tools.py b/tools/forensic_tools.py index 57e9d92..592988e 100644 --- a/tools/forensic_tools.py +++ b/tools/forensic_tools.py @@ -8,10 +8,10 @@ from core import HackingToolsCollection class Autopsy(HackingTool): TITLE = "Autopsy" DESCRIPTION = "Autopsy is a platform that is used by Cyber Investigators.\n" \ - "[!] Works in any Os\n" \ - "[!] Recover Deleted Files from any OS & MEdia \n" \ + "[!] Works in any OS\n" \ + "[!] Recover Deleted Files from any OS & Media \n" \ "[!] Extract Image Metadata" - RUN_COMMANDS = "sudo autopsy" + RUN_COMMANDS = ["sudo autopsy"] def __init__(self): super(Autopsy, self).__init__(installable = False) From fb4f05aad6d943f95969dd3dad613c076b9b98a9 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 15 Jun 2022 13:37:49 +0200 Subject: [PATCH 7/7] make mypy a mandatory test --- .github/workflows/lint_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index eee4a73..bdf7288 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -19,7 +19,7 @@ jobs: - run: isort --check-only --profile black . || true - run: pip install -r requirement.txt || pip install -r requirements.txt || pip install --editable . || pip install . || true - run: mkdir --parents --verbose .mypy_cache - - run: mypy --ignore-missing-imports --install-types --non-interactive . || true + - run: mypy --ignore-missing-imports --install-types --non-interactive . - run: pytest . || true - run: pytest --doctest-modules . || true - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true