NLeSC / python-template

Netherlands eScience Center Python Template
https://research-software-directory.org/software/nlesc-python-template
Apache License 2.0
196 stars 77 forks source link

Add pylintrc #267

Open jspaaks opened 3 years ago

jspaaks commented 3 years ago

Currently it's not clear how to make a configuration change, like for example you want 120 characters per line instead of 79. Where does this information go?

I propose we add .pylintrc from howfairis, the pylintrc there is almost default with some minor changes. Here is the PR that describes the diff from default: https://github.com/fair-software/howfairis/pull/311

jspaaks commented 3 years ago

I'd like to add this to 0.4.0

jspaaks commented 3 years ago

PR #271

jspaaks commented 3 years ago

PR was merged #271 closing this

sverhoeven commented 3 years ago

Inclusion of .pylintrc caused more lint errors see #227 , I thought minor changes would not cause that many errors.

We should decide if we want those minor changes. If we do we should fix those warnings. Otherwise make pylintrc same as prospector defaults so current code is lint warning free.

bouweandela commented 3 years ago

In the guide we recommend setting strictness to veryhigh setting for best results. However, I noticed that in this repository the setting is medium? Prospector is probably picking up the pylintrc file now (the pylint defaults are probably more like prospector's veryhigh setting), as it's just a thin wrapper around a collection of linting tools.

egpbos commented 2 years ago

This configuration should be in .prospector.yml. Perhaps that wasn't there yet when the pylintrc file was added? Btw, it has been removed by #287, so now it's just .prospector.yml. Indeed, in there, strictness is currently set to medium. I personally would also prefer having it set to veryhigh, and by the way also to add docstring linting by default. However, I realize that for starting projects, this is very annoying in practice. In the beginning, you typically don't want perfect, you just want some first results for getting started.

A good compromise might be to run prospector on strict in a separate workflow job or step, but to not fail on that, so that you aren't bothered immediately with such results. In parallel, prospector will also run in medium-strictness mode and that one will fail. We could add a "next-step" issue for activating failing on strict linting so that people will have a reminder.