Skip to content

MAINT: Enable linting with ruff E501 #28947

@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/core/_add_newdocs*py
  • numpy/core/code_generators/generate_umath.py
  • numpy/_typing/*py (skip, as for typing we use a 130 char limit)
  • 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" (skip, as for typing we use a 130 char limit)

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy