Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT: Enable linting with ruff E501 #28947

Open
@eendebakpt

Description

@eendebakpt

Within the numpy codebase we aim to keep the maximum line length at 88 (#27320). We will enforce the ruff E501 rule for the codebase step by step:

List of files to be handled:

  • test*.py
  • benchmarks/*.py
  • benchmarks/benchmarks/bench_linalg.py
  • numpy/_build_utils/*py
  • numpy/init.py
  • numpy/_core/**
  • numpy/_core/tests/**
  • numpy/core/**
  • numpy/_typing/*py
  • numpy/lib/*py
  • numpy/lib/tests/*py
  • numpy/linalg/*py
  • numpy/linalg/tests/*py
  • numpy/linalg/tests/test_linalg.py
  • numpy/ma/*py
  • numpy/ma/tests/*py
  • numpy/polynomial/*py
  • numpy/tests/*py
  • numpy/random/*py
  • numpy/f2py/*py"
  • numpy*pyi"

Procedure:

  1. Select a couple of files to fix (for example all python files in numpy/random)
  2. Update ruff.toml to enable ruff E501
  3. Change python files to have maximum line length 88
  4. If some formatting really is better with longer lines, use # noqa: E501 to make an exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions