PyWard is a lightweight command-line linter for Python code. It helps developers catch optimization issues and security vulnerabilities.
Install from PyPI:
pip install pyward-cliEnsure that you have Python 3.7 or newer.
Basic usage (runs all checks):
pyward <file_or_directory>-
-r, --recursive
Scan directories recursively. -
-o, --optimize
Run only optimization checks. -
-s, --security
Run only security checks. -
-k, --skip <check>
Skip a specific check by its name (e.g.--skip unused_imports). -
-v, --verbose
Show detailed warnings even if no issues are found. -
--versionShow the PyWard version and exit.
append_in_loopdeeply_nested_loopsdict_comprehensiongenexpr_vs_listlen_call_in_looplist_build_then_copymembership_on_list_in_loopopen_without_contextrange_len_patternset_comprehensionsort_assignmentstring_concat_in_loopunreachable_codeunused_importsunused_variables
exec_evalhardcoded_secretspickle_usagepython_json_loggerssl_verificationsubprocess_usageurl_open_usageweak_hashing_usageyaml_load
Scan recursively and skip unused_imports:
pyward -r --skip unused_imports demoRun only security checks:
pyward -s my_script.pyVerbose output:
pyward -v my_script.pySee CONTRIBUTING for details.
MIT License — see LICENSE.
|
Karan Vasudevamurthy |
cafewang |
Reeck Mondal |
Priyanshu Gupta |
nature011235 |
DannyNavi |
|
André |
Nayana Jagadeesh |
Ritwik Singh |
Aydyn Maxadov |