Questions tagged [ruff]

5 questions
5
votes
0 answers

Ruff does not autofix line-too-long violation

I have a python project and I am configuring latest version of ruff for that project for linting and formating purpose. I have the below settings in my pyproject.toml file: [tool.ruff] select = ["E", "F", "W", "Q", "I"] ignore = ["E203"] # Allow…
Sukanya Pai
  • 666
  • 9
  • 24
4
votes
0 answers

Trying to change the Ruff default line length

I was recently introduced to Ruff a python linter. I have an existing directory with lots of files. I thought to try it out and made a pyproject.toml file in the directory. I want to set the line-length high (150) to show less errors but the default…
Shane S
  • 1,747
  • 14
  • 31
3
votes
1 answer

How to ignore environment directory when using python ruff linter in console

I was trying ruff linter. I have a file structure like below project_folder ├── env # Python enviroment [python -m venv env] │ ├── Include │ ├── Lib │ ├── Scripts │ ├── ... ├── __init__.py └── numbers.py I am trying to use this code I…
2
votes
1 answer

ruff : E999 SyntaxError on match/case syntax

I got a strange issue with ruff (0.0.209) and python 3.10.9 interpreter when I use match/case syntax. For instance, this simple code : from http import HTTPStatus http_status = HTTPStatus.OK match http_status: case HTTPStatus.OK: …
Romain
  • 334
  • 4
  • 10
0
votes
0 answers

Setting up Ruff (Python Linter)

As far as I understood ruff implements pycodestyle rules by default. However, when I run my code through pycodestyle I get: test.py:5:1: E302 expected 2 blank lines, found 1 test.py:8:1: E302 expected 2 blank lines, found 1 test.py:13:9: E129…
SrdjaNo1
  • 755
  • 3
  • 8
  • 18