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

add ASYNC300 create-task-no-reference #256

Merged
merged 4 commits into from
May 27, 2024

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented May 27, 2024

Fixes #207, originally requested by @alicederyn in Zac-HD/flake8-async-archive#5

The doc and error message can probably be improved.

I went for quite comprehensive checks for possible ways of not using the value. I don't think ~anybody that installs this plugin would hit any of them, but if/when this gets packaged into ruff I could imagine one of the weirder corner cases getting hit.

@jakkdl
Copy link
Member Author

jakkdl commented May 27, 2024

whoa, slow tests found a crash!
Somehow the value attribute of a cst.Attribute is neither cst.Attribute nor cst.Name. The docs do say that it can be any BaseExpression, but I'm failing to make sense of that. Time to dig into the mccabe==0.7.0 source code.

EDIT: ah, self.nodes[n1].append(n2)

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Renumbered to ASYNC300 following the scheme I just proposed in #257, looks great!

@Zac-HD Zac-HD changed the title add ASYNC120 create-task-no-reference add ASYNC300 create-task-no-reference May 27, 2024
@Zac-HD Zac-HD merged commit 6a35f4a into python-trio:main May 27, 2024
10 checks passed
@jakkdl jakkdl deleted the ref_create_task branch May 28, 2024 07:53
@jakkdl
Copy link
Member Author

jakkdl commented May 28, 2024

and your changes look good too, thanks!

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.

Checks for asyncio.create_task()
2 participants