question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Annotation complexity should not fail on expressions

See original GitHub issue

Bug report

This code:

def some() -> 'test expression':
    ...

Makes flake8-annotation-complexity to fail. We need to ignore this case silently.

Related: #1170

Demo: https://asciinema.org/a/IIjIfkVKytmZ1F5c2YufMORdi

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
leksusscommented, Feb 28, 2020

@sobolevn thank you for so useful answer!

0reactions
sobolevncommented, Feb 28, 2020

@leksuss we cannot control why people would do that. But, we know that they will. And our goal is to help them not to make this mistake.

I appreciate your help! Thanks a lot! Since this one is the first PR for you, here are the steps:

  1. You fork this repository: https://help.github.com/en/github/getting-started-with-github/fork-a-repo
  2. Then (inside your fork) you add new failing tests here: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/test_ast/test_complexity/test_annotation_complexity/test_annotation_complexity_nesting.py You goal at this point is to make sure that you can reproduce the bug. It is called ATDD
  3. Then (inside your fork) you edit https://github.com/wemake-services/wemake-python-styleguide/blob/master/wemake_python_styleguide/logic/complexity/annotations.py and fix the bug.
  4. Then you run your tests again and they should pass this time!
  5. You submit a PR: https://opensource.com/article/19/7/create-pull-request-github
  6. Done!

You can find the information about running tests here: https://github.com/wemake-services/wemake-python-styleguide/blob/master/CONTRIBUTING.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java static code analysis: Expressions should not be too ...
A single expression's complexity should not become too high to keep the code readable. Noncompliant Code Example. With the default threshold value of...
Read more >
Annotations for enforcing cyclomatic complexity and LCOM ...
Is anyone aware of a group of annotations and configurable annotation processor(s) that can be run from the compiler, and which will make...
Read more >
Modeling the Complexity of Manual Annotation Tasks
One difficulty concerns multi-word expressions that the campaign ... complexity of relational annotations should not be underestimated: even if annotators ...
Read more >
Allow type annotation on catch clause variable #20024 - GitHub
I'm fine with allowing only a single catch so as not to change the behavior of javascript, but I think it's perfectly in...
Read more >
Annotations in Java - GeeksforGeeks
Annotations are not pure comments as they can change the way a program is treated by the compiler. See below code for example....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found