[PYTHON] When wildcard specification does not work with pylint

Overview

A story about trying to pylint all python files directly under the current directory. For those who may be worried about the same thing, we will provide a temporary solution.

Conclusion

The solution is below. --First create an empty __init__.py. --When executing the command, specify the folder after going up one level with ... (I don't know the reason)

environment

What i did

At first, the folder structure looks like this.

C:\Users\{username}\Desktop\project
  └aaa.py

I tried the following from the command prompt.

(dev) C:\Users\{username}\Desktop\project>pylint *.py
************* Module *.py
*.py:1:0: F0001: No module named *.py (fatal)

that. .. .. Can't you use wildcards?

After researching various things, I felt that I could go if I made __init__.py in the same hierarchy. __init__.py can be an empty file.

C:\Users\{username}\Desktop\project
 ├__init__.py
  └aaa.py

Can this be done below?

(dev) C:\Users\{username}\Desktop\project>pylint .
(dev) C:\Users\{username}\Desktop\project>

This is also useless. .. .. Just in case, try it one level higher.

(dev) C:\Users\{username}\Desktop\project>cd ..
(dev) C:\Users\{username}\Desktop>pylint project
************* Module project.aaa.py
project\aaa.py:24:0: C0301: Line too long (109/100) (line-too-long)
(Many others)
-----------------------------------
Your code has been rated at 2.20/10

(dev) C:\Users\snkmr\Desktop\repo>

Oh, it's done! !! !! But it's too inconvenient to go up the hierarchy ... Maybe Wanchan can do this? ??

(dev) C:\Users\{username}\Desktop>cd project
(dev) C:\Users\{username}\Desktop\project>pylint ..\project
************* Module project.aaa.py
project\aaa.py:24:0: C0301: Line too long (109/100) (line-too-long)
(Many others)
-----------------------------------
Your code has been rated at 2.20/10

(dev) C:\Users\snkmr\Desktop\repo>

I was able to go! !! !! I don't know if this is the correct solution, but I solved it.

Conclusion (repost)

The solution is below. --First create an empty __init__.py. --When executing the command, specify the folder after going up one level with ... (I don't know the reason)

Recommended Posts

When wildcard specification does not work with pylint
Command when ACPI shutdown does not work in VirtualBox
Day 65 (Solution) Jupyter notebook does not work with Kernel Not Conected.
LocateCenterOnScreen does not work on PyAutoGui
Solution when background-cover of Linux version VS Code does not work
Tkinter canvas (window) does not start when running Python 3.7.4 with Atom
When the program pip installed on Mac / Marvericks does not work
Check points when MIDI does not work in a program using SDL_mixer
When Anaconda Navigator (Mac) does not start
When cv2.VideCapture (aviname) does not read well
(Under investigation) USB camera that does not work with WebRTC on RPi4
Virtualenv does not work on Python3.5 (Windows)
Check items when the imported python module does not work as expected
Notes on what to do when matplotlib scatter () / scatter3d () does not work
Example of what to do when the sample script does not work (OpenCV-Python)
Patch when full text search does not work in GAE / Python local environment
After installing php7.2, the php command does not work
Jinja2 2.9.6 does not work on Lambda Python 3 series
[Python] Expression (1,2) does not make tuples with parentheses
Spider not found appears when crawling with Scrapy
What to do when python3 type venv does not work well on Raspberry Pi
[systemd] How to deal with the problem that fancontrol does not work after suspending
[Python] Precautions when it does not work even if TimedRotatingFileHandler is set in basicConfig in python2
Note ((1) csv.reader AttributeError, (2) get_sheet_by_name DeprecationWarning, (3) .delete_cols does not work)
Solution when Linux does not recognize the built-in camera
When architecture not supported comes out with pip (Mac)