简体   繁体   中英

How to run Flake8 on all python files via terminal on Pycharm?

I'm trying to run Flake8 over all the Python files in my project.

How to make it work?

flake8 *.py

I get this error:

.py:0:1: E902 OSError: [Errno 22] Invalid argument: ' .py'

I'm able to run flake8 on a single file

To run Flake8 on all Python files in PyCharm, you can follow these steps:

Open the Terminal window in PyCharm by going to View > Tool Windows > Terminal.

Make sure that you have Flake8 installed in your project. You can install Flake8 by running the following command in the terminal:

pip install flake8

Navigate to the root directory of your project in the terminal.

Run the following command to run Flake8 on all Python files in your project:

flake8 .

This will run Flake8 on all Python files in the current directory and its subdirectories.

Alternatively, you can also run Flake8 on specific files or directories by specifying the file or directory names as arguments to the flake8 command. For example:

flake8 path/to/file1.py path/to/file2.py

or

flake8 path/to/directory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM