Open peterjc opened 2 weeks ago
hi -
I disagree with these linter rules and I would disable them. you can change your own script.py.mako to resolve. feel free to send a pull request otherwise I would close this.
I agree not everyone will use these rules, and they can be disabled on a file by file basis if the rest of the project does.
However, the PR is simple and small, and will mean less work for those alembic users which do run with the docstring linter rules enabled.
I'm personally -1 here. The suggested doc strings in the PR don't add anything in my point of view. As mike mentioned alembic init is a one time thing and you are supposed to customize your env.py and make template to fit your project.
Up to you mike, but I would close this and not merge the PR
I think it's harmless to have a basic docstring in the upgrade/downgrade method. I think a little bit of putting a more complete description in the docstring as to how the code gets there and that it should be edited etc. but then I dont konw that I want a huge paragraph being spit out there.
Describe the bug
Scripts created under
<project>/alembic/versions/<name>.py
from the Mako template fail the pydocstyle D103 style check, e.g. via flake8 or ruff check:Expected behavior
The templates would include minimal docstrings for the
upgrade
anddowngrade
functions.To Reproduce
Followed the tutorial, having enabled ruff check in
alembic.ini
and then run this with a trailing dot in the message to avoid D400 or D415.Or without using this via the configuration, follow that with:
Error
Versions.
Additional context
PR to follow.
Have a nice day!