Python celebrates 30 years, do you have some tips/learnings you can share? How to configure Codacy Python linters?

Python celebrates 30 years “young and still going strong! Python’s devs like to keep Python fun to use. The language’s name is a tribute to the British comedy group Monty Python.” Cheers to Python!

PEP 8 – Style Guide for Python Code gives coding conventions for the Python code comprising the standard library in the main Python distribution.

Also, one of our users asked how to configure Codacy Python linters, "I recently enabled GitHub Codacy scans on my repo. The Pylint* and Prospector modules (if that is the right terminology) report a lot of warnings:
enter image description here

I have to believe there’s a way to configure what they flag, perhaps via an rc file or a .yml placed somewhere , but I haven’t figured out what the config files should be named, where they should be placed, and what the allowable syntax(es) are. I’d be happy to RTFM if I could figure out the FM to R.

How do I configure the linters invoked by Codacy code scanners on GitHub?"

Codacy now supports these: Bandit, Prospector, Pylint, (Static Analysis). PMD CPD, (Duplication), and Radon (Complexity).

I know some of our members use Python and we’d love to hear some of the tips and suggestions you have specifically for this programming language.
@EmilyBourne @JoaoVasques @kezhenxu94 @masbentoooredoo @mdantonio @MrGeeDee @mustafaozhan @piairoeduardo @ppfeufer @romain @vishalpathikgupta feel free to exchange some insights, looking forward to reading your ideas on this :slight_smile:
Also, sorry if I forgot someone, everyone is more than welcome to share knowledge and experience!

3 Likes

I started coding with Python many years ago and if I didn’t use it in a professional way so I don’t have much tips to share.
But it’s a programming language that I like very much, especially because it comes with a style guide. I think it’s a great language to learn coding because of that; it forces us to be rigorous and take good habits.

On the screenshot, I notice that there are reported issues from both Pylint (can be configured for either Python 2.x or Python 3.x) and Pylintpython3 (the recommended tool for Python 3.x). So the first suggestion that I have would be to use a Codacy configuration file to disable one of the tools, depending on the Python version being used on the project.

1 Like

According to the documents Codacy will use the .bandit file in the root of my repository. I have tried adding one to skip reporting assert as an error in the tests classes but it doesn’t seem to get picked up.

What am I doing wrong? Here is my public repo on GitHub

Was it the same issue as you described here? If not, I can try to take a look :smiley: