mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +00:00
`flake8.main.cli.main()` is the primary entry point for the command-line implementation of flake8 (invoked via `__main__` or `console_scripts`). Therefore, it is reasonable for the entry point to be responsible for obtaining command line arguments from `sys.argv` there. Note that `sys.argv[1:]` is necessary in order to strip off the script name. Formerly, this was not needed in `Application.parse_preliminary_options_and_args()`, which was using `sys.argv[:]` because the result of the argument parsing was just for determining additional configuration to be loaded. Then, the *real* CLI argument parsing was forwarding the original `None` value to `argparse.ArgumentParser.parse_args()`, which internally was obtaining arguments as `sys.argv[1:]`. Additionally, the contract for various argument parsing methods to be guaranteed a `List[str]`. |
||
|---|---|---|
| .. | ||
| subdir | ||
| test_aggregator.py | ||
| test_api_legacy.py | ||
| test_checker.py | ||
| test_main.py | ||
| test_plugins.py | ||