Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying additional directories for Python linting #90

Merged
merged 9 commits into from
Aug 9, 2023

Conversation

cowlingjosh
Copy link
Contributor

Often projects contain an examples/ or bin/ directory which contains Python source code, but by default Kraken only lints against source code in src and tests directories.


This MR adds the ability to specify any number of extra directories for which lint tasks (black, flake8, isort, mypy, pycln, pylint) should also be run against. This functionality is exposed via the python_settings function which modifies the global PythonSettings object.

@cowlingjosh cowlingjosh added type: enhancement New feature or request only: kraken-std This issue affects only kraken-std. labels Jul 27, 2023
@cowlingjosh cowlingjosh self-assigned this Jul 27, 2023
kraken-std/pyproject.toml Outdated Show resolved Hide resolved
kraken-std/src/kraken/std/python/settings.py Outdated Show resolved Hide resolved
kraken-std/src/kraken/std/python/settings.py Outdated Show resolved Hide resolved
@ntrinquier
Copy link
Contributor

@cowlingjosh is this still relevant?

@cowlingjosh cowlingjosh force-pushed the jcowling/additional-python-directories branch from 7722246 to d553923 Compare August 7, 2023 17:10
@cowlingjosh
Copy link
Contributor Author

@cowlingjosh is this still relevant?

Apologies for the late reply on this @ntrinquier, I missed the email notifications from Github 🤦 Thanks for the review, I have added your suggestions.

Copy link
Contributor

@ntrinquier ntrinquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cowlingjosh one last small comment, let me know what you think!

kraken-std/src/kraken/std/python/settings.py Outdated Show resolved Hide resolved
kraken-std/src/kraken/std/python/tasks/black_task.py Outdated Show resolved Hide resolved
@cowlingjosh cowlingjosh force-pushed the jcowling/additional-python-directories branch from ac4601d to 1b20b3a Compare August 8, 2023 16:57
@cowlingjosh
Copy link
Contributor Author

@ntrinquier thanks again for the suggestions, I have made the changes.

I have made two other changes as well:

  • Updated the poetry.lock file of the kraken-wrapper subproject after the recent ^0.31.0 version bump.
  • Changed the log level of the directory does not exist statements to DEBUG, as most likely we want some defaults (such as examples/ etc.) and do not want to overload the output for when these directories do not exist (which will be often).

@ntrinquier ntrinquier merged commit c17c179 into develop Aug 9, 2023
13 checks passed
@ntrinquier ntrinquier deleted the jcowling/additional-python-directories branch August 9, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
only: kraken-std This issue affects only kraken-std. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants