LibreLingo
LibreLingo copied to clipboard
pylint config: enable "missing-function-docstring"
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:
- Enable the rule in pylintrc (see this commit for an example)
- 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
I would love to take up this Issue. Regards.
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
Hello! If this issue is still open I would be happy to take it.
Go for it @ProtKsen !