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

Discussion about linters and formatters #5

Open
nifadyev opened this issue Aug 26, 2024 · 5 comments
Open

Discussion about linters and formatters #5

nifadyev opened this issue Aug 26, 2024 · 5 comments

Comments

@nifadyev
Copy link
Contributor

Let's discuss improvements and changes related to linters and formatters.
If you have any tool, package, config, or script to share, feel free to suggest it into this discussion.

@nifadyev
Copy link
Contributor Author

Current flake8 config is irrelevant - there are WPS rules in ignore block. But these rules are for wemake-python-styleguide which is not listed in dev dependencies.

Another issue is huge pylint config inside pyproject.toml. I suppose pylint related rules should be moved to .pylintrc and checked for relevance.

In general, It is worth taking ruff into consideration as a replacement for flake8 + plugins, black and isort. Most of the rules from evrone config are supported by ruff but it is easier to maintain, faster to run and install.

@batazor
Copy link
Member

batazor commented Aug 26, 2024

And proof for ruff:

Shows a bar chart with benchmark results.

Linting the CPython codebase from scratch.

  • ⚡️ 10-100x faster than existing linters (like Flake8) and formatters (like Black)
  • 🐍 Installable via pip
  • 🛠️ pyproject.toml support
  • 🤝 Python 3.13 compatibility
  • ⚖️ Drop-in parity with Flake8, isort, and Black
  • 📦 Built-in caching, to avoid re-analyzing unchanged files
  • 🔧 Fix support, for automatic error correction (e.g., automatically remove unused imports)
  • 📏 Over 800 built-in rules, with native re-implementations
    of popular Flake8 plugins, like flake8-bugbear
  • ⌨️ First-party editor integrations for
    VS Code and more
  • 🌎 Monorepo-friendly, with hierarchical and cascading configuration

@nifadyev
Copy link
Contributor Author

I suppose we should wait some time, let's say 2 weeks. Maybe there are some other opinions and options to consider. If no, then we shall migrate current linter config to ruff and then validate linter checks

@grigoryvp
Copy link

+1 for ruff, it's hightly recommended by core devs I personally know

@nifadyev
Copy link
Contributor Author

Above is PR with ability to choose linter on project initialization. Probably it is suitable option. Please review and share your opinions

soltanoff added a commit that referenced this issue Sep 23, 2024
#5: Allow to choose linter, add configs for Ruff
soltanoff added a commit that referenced this issue Sep 26, 2024
…-own-file

#5: Move Pylint config to .pylintrc.toml, remove default config values
soltanoff added a commit that referenced this issue Sep 26, 2024
…ke8-rules

Remove irrelevant Flake8 config options
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

No branches or pull requests

3 participants