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-cli
Ensure 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. -
--version
Show the PyWard version and exit.
append_in_loop
deeply_nested_loops
dict_comprehension
genexpr_vs_list
len_call_in_loop
list_build_then_copy
membership_on_list_in_loop
open_without_context
range_len_pattern
set_comprehension
sort_assignment
string_concat_in_loop
unreachable_code
unused_imports
unused_variables
exec_eval
hardcoded_secrets
pickle_usage
python_json_logger
ssl_verification
subprocess_usage
url_open_usage
weak_hashing_usage
yaml_load
Scan recursively and skip unused_imports:
pyward -r --skip unused_imports demo
Run only security checks:
pyward -s my_script.py
Verbose output:
pyward -v my_script.py
See CONTRIBUTING for details.
MIT License — see LICENSE.
Karan Vasudevamurthy |
cafewang |
Reeck Mondal |
Priyanshu Gupta |
nature011235 |
DannyNavi |
André |
Nayana Jagadeesh |
Ritwik Singh |
Aydyn Maxadov |