hashlookup / hashlookup-forensic-analyser

Analyse a forensic target (such as a directory) to find and report files found and not found from CIRCL hashlookup public service - https://circl.lu/services/hashlookup/
https://hashlookup.github.io/hashlookup-forensic-analyser/
Other
121 stars 13 forks source link

Added some python tests using github actions #6

Closed signorrayan closed 2 years ago

signorrayan commented 2 years ago
  1. added some tests in github actions such as :

bandit --recursive --skip B106,B110,B404,B602,B603,B607,B303 black --check flake8 . --count --ignore=B,E203,E722,W503,W605 --max-complexity=28 --max-line-length=220 --show-source --statistics isort --check-only --profile black mypy --allow-redefinition --ignore-missing-imports --install-types --non-interactive



2. changed the Module name `platform` to `pl` because the variable `platform` has the same name and a test was failed.
`bin/hashlookup-analyser.py:20: error: Incompatible types in assignment (expression has type "str", variable has type Module)`
sthagen commented 2 years ago

@signorrayan I strongly suggest to keep the preference for single apostrophe strings and add -S to the black call. This way the PR is true to its title and is not restyling the whole script :wink:

signorrayan commented 2 years ago

@sthagen Thanks. do you mean black -S . instead of black --check . ?

sthagen commented 2 years ago

@signorrayan no in addition. The option -S is the short form of — skip-string-normalization And does not interfere with other commands/options. In my projects I often use calls like:

black -S -l 120 --target-version py39 --check --diff script_or_module tests

… and do rarely have to change when supporting other peoples‘ projects - maybe the Python target version sometimes needs adjustment of course.

Maybe at this point (conflicts) it is best to revert the changes to the main script, merge the fresh version from @adulau including the fix for #4 and apply again the platform alias patch?

adulau commented 2 years ago

Thanks @signorrayan for the idea and the new GitHub action. It's great. I added it in the repository and updated according to @sthagen feedback. It's nice to see people looking carefully at all the details.