GithubHelp home page GithubHelp logo

Comments (5)

m-burst avatar m-burst commented on July 28, 2024 1

Hi James,

Thanks for raising this.
Since this plugin is based on flake8, and flake8 itself does not provide any infrastructure for automatic fixing of lint errors, this would have to be implemented from scratch, and I am not sure I have the capacity for this in the foreseeable future.

In the meantime, I would like to note two things.
1 — rules such as PT001 and PT006 are configurable, and if your project(s) have a consistent code style but it is different from our default, you can simply use non-default config values. The supported configuration options are listed in the readme.
2 — there are flake8 plugins/wrappers which are specifically designed to adopt flake8 into existing codebases. One of them is flakehell, which introduces a concept of baseline. I do not have any firsthand experience with such tools, but they might prove useful in your case.

from flake8-pytest-style.

m-burst avatar m-burst commented on July 28, 2024

Also, as mentioned in pytest-dev/pytest#10709 (comment), the rules from flake8-pytest-style are available in Ruff with some autofixes, including PT001 and PT006

from flake8-pytest-style.

cclauss avatar cclauss commented on July 28, 2024

@jamesbraza Ruff is capable of automating these fixes.

However, it is worth noting that PT001 runs counter to the example usage in the pytest docs.

from flake8-pytest-style.

m-burst avatar m-burst commented on July 28, 2024

Hi @cclauss,

As mentioned in my comment above and in the docs for PT001, it is configurable: you can change the flag in your flake8 config to invert the rule behavior.

from flake8-pytest-style.

cclauss avatar cclauss commented on July 28, 2024

I thought pytest docs usage examples would be the default behavior and that deviations would require special settings.
I will use pytest-fixture-no-parentheses so that my code matches the pytest docs. Thanks.

from flake8-pytest-style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.