LibreLingo icon indicating copy to clipboard operation
LibreLingo copied to clipboard

pylint config: enable "missing-function-docstring"

Open kantord opened this issue 3 years ago • 4 comments

We enabled pylint in the project, however several code style violations already exist. There's no point in enabling rules and then not enforcing them, therefore any rule that is not already enforced is currently disabled.

One of these rules if the one you can see in the title is this issue.

How to solve Create a pull request with 2 commits. The commits should:

  1. Enable the rule in pylintrc (see this commit for an example)
  2. Make sure that the CI still passes after creating your pull requests. If the CI fails due to the violations of the rule you've just enabled, then fix the code style mistake in the code and create a new commit. (see this commit for an example)

Take a look at this MR to see how your pull request should look: https://github.com/kantord/LibreLingo/pull/1895

Another (bigger) example of a similar pull request: https://github.com/kantord/LibreLingo/pull/1893

An example of how to write your commit messages:

Why solve like this I have considered keeping the rules enabled but allowing the CI to pass with a certain number of pylint rule violations. I don't like this approach though, because it results in a very long and polluted output in pylint, which would render the output unusable for practical purposes.

Additional context This is a good first issue because it will likely take little time to fix, and it does not require knowledge of LibreLingo or the project structure. It also does not require you to be an expert in

Some things you might find useful:

  • How to set up the project locally: https://librelingo.app/docs/#setting-up-the-development-environment
  • How to run pylint locally: poetry run pylint $(git ls-files '*.py')
  • How to fix code style issues with black. This can be useful to fix indentation after you changed the code: poetry run black apps
  • Where we store our pylint config: https://github.com/kantord/LibreLingo/blob/main/pylintrc

kantord avatar Dec 30 '21 06:12 kantord

I would love to take up this Issue. Regards.

hs094 avatar Jan 06 '22 21:01 hs094

sure @iamhardikat11, go for it!

I kinda see that it might be a big one though. Because there might be a lot of functions with no docstring that will need this.

In that case feel free to either do a partial solution (i. e. only add some docstrings)

Or alternatively, add a few docstrings (that seem clear to you) and basically add a TODO message for the rest, in the docstring

kantord avatar Jan 07 '22 18:01 kantord

Hello! If this issue is still open I would be happy to take it.

ProtKsen avatar Apr 17 '23 08:04 ProtKsen

Go for it @ProtKsen !

kantord avatar Apr 17 '23 17:04 kantord