Repository navigation
Add TRIO200, user-configured warnings for blocking sync calls in async function - #80
Conversation
407849e to
89e52f0
Compare
|
sad, I wrote and confirmed that a version with |
| @@ -0,0 +1,22 @@ | |||
| # ARGS --trio200-blocking-calls=bar->BAR,bee->NOERROR,bonnet->NOERROR,bee.bonnet->BEEBONNET | |||
There was a problem hiding this comment.
nope, suppose I might as well change them to BEE and BONNET to avoid confusion
There was a problem hiding this comment.
or actually no that could in theory cause some other confusion/testing error since BEE and BONNET are substrings of BEEBONNET.
Maybe all magic words should be surrounded by underscores or something, not sure.
|
Looks good so far! How much would break if we just declared that 3.8 was only best-effort support? I don't really mind requiring 3.9+ to run the linter, now that 3.11 is out. My (weakish) preference for |
|
For just this change it would break 107 and 108 with a user-configured decorator, 200, and almost certainly all other 2xx messages. But there's generally some developing overhead to account for 3.8, since the AST has changed since then (e.g. https://github.com/PyCQA/flake8-bugbear/blob/main/bugbear.py#L683-L689) so it can sometimes be a non-insignificant overhead to debug issues caused by it, and even if that's just a matter of skipping broken tests you'd still have to figure out where/why/how it breaks and insert skips, and also update tests to skip it. So I personally wouldn't complain if we stopped testing on it entirely (and running the full test suite would be faster, yay!). |
Makes sense. I'm mostly just colored by mentally parsing it as a dict, and seeing |
9603138 to
8cd321a
Compare
|
fixed todo's, changed |
8cd321a to
fe0ae2b
Compare
fe0ae2b to
e37c467
Compare
610f995 to
fea41fe
Compare
|
Fixed all comments, needed to split a couple lines that were long - and realized I've been inconsistent whether spaces should be at the start of the new line or at the end of the previous. Didn't find any great source on what's the preferred style, but seems like trailing space is more common. (Something for Black?) shed also went ahead with a bunch of changes (though removing I also managed to get rid of all |
Implements the config option in #58
This ended up touching surprisingly many spots in various places, most of them unintentionally. So sorry for the diff being a bit sprawling. Going through the diff and explaining all changes:
[flake8_trio.py]
fnmatch_qualified_namefor that to work smoothly, which doesn't affect the decorator matching using it.:as the splitter if it was me, but easily configurable inParseDict.f{var!r}I couldn't resist adding it toListOfIdentifiersas well ^^;[pyproject.toml]
[tests/test_decorator.py]
test_xxx_optionsintest_flake8_trio.py[tests/test_flake8_trio.py]
# ARGSconstruct in a test file to specify command line flags to be used when running the file.test_113_optionsandtest_114_optionscould be cleaned up given this new functionality. Leaving that for a later PR though.test_200_options, partly because testing is good:tm:, but in large part because I wanted to silence them in my CLI even when running with-s. So added that totest_114_optionsas well.TODO: