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

async101 & async119 now respects transform-async-generator-decorators #316

Merged
merged 6 commits into from
Nov 17, 2024

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented Nov 15, 2024

fixes #315

I noticed the flag wasn't documented at all in usage.rst, so added it there.
I also think it should be enabled for ASYNC119?

The flag becomes somewhat weirdly named for ASYNC101 since it will also suppress errors in sync functions. Idk if it warrants a rename, or I should just mention it in the docs, or explicitly only make it have an effect on async funcs, or something else.

@jakkdl
Copy link
Member Author

jakkdl commented Nov 15, 2024

hrm, I kinda wanna make the test_changelog_and_version tests be part of pre-commit. I keep forgetting to check those before pushing

Comment on lines 7 to 9
24.11.1
=======
- :ref:`ASYNC101` and :ref:`ASYNC119` are now silenced for decorators in :ref:`transform-async-generator-decorators`
Copy link
Member

Choose a reason for hiding this comment

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

probably remove the changelog from the first of this and #317 to merge, so we do a single release?

@jakkdl
Copy link
Member Author

jakkdl commented Nov 17, 2024

hrm, I kinda wanna make the test_changelog_and_version tests be part of pre-commit. I keep forgetting to check those before pushing

wait, I just noticed we have

def update_version() -> None:
    # If we've added a new version to the changelog, update __version__ to match
    last_version = next(iter(get_releases()))
    if last_version != VERSION:
        INIT_FILE = ROOT_PATH / "flake8_async" / "__init__.py"
        subs = (f'__version__ = "{VERSION}"', f'__version__ = "{last_version}"')
        INIT_FILE.write_text(INIT_FILE.read_text().replace(*subs))

which means the test for checking changelog matching __version__ is kinda redundant (contributor docs also say you should increment __version__). It'd perhaps be safer to do assert last_version == VERSION, and if we want the convenience of replacing __version__ that should perhaps be done in the pre-commit hook.

@jakkdl
Copy link
Member Author

jakkdl commented Nov 17, 2024

Oh I can't even have FUTURE stuff in the changelog because tests must pass to merge. I'll def do some retooling of this at some point

@jakkdl jakkdl merged commit 4fa719f into python-trio:main Nov 17, 2024
10 checks passed
@jakkdl jakkdl deleted the transform_async_generator_decs branch November 17, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

transform-async-generator-decorators should affect ASYNC101 as well as ASYNC900
2 participants