Python/Line Length

From Omnia
Revision as of 20:13, 3 November 2026 by Kenneth (talk | contribs) (Created page with "== .editorconfig == <pre> # Project-wide line length. Keep in sync with pyproject.toml. [*.py] max_line_length = 99 </pre> == .flake8 == <pre> # Project-wide line length. Keep in sync with pyproject.toml. [flake8] max-line-length = 99 </pre> == pyproject.toml == <pre> [build-system] requires = ["setuptools>=68"] build-backend = "setuptools.build_meta" [project] name = "MYPROJECTNAME" version = "0.1.0" requires-python = ">=3.8" [tool.setuptools.packages.find] where...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.editorconfig

# Project-wide line length. Keep in sync with pyproject.toml.
[*.py]
max_line_length = 99

.flake8

# Project-wide line length. Keep in sync with pyproject.toml.
[flake8]
max-line-length = 99

pyproject.toml

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"

[project]
name = "MYPROJECTNAME"
version = "0.1.0"
requires-python = ">=3.8"

[tool.setuptools.packages.find]
where = ["."]
include = ["MYPROJECTNAME*"]
exclude = ["MYPROJECTNAME.egg-info*"]

# Project-wide line length: 99. flake8 and pycodestyle (pep8) cannot read
# pyproject.toml; keep .flake8, setup.cfg and .editorconfig in sync.
[tool.black]
line-length = 99

[tool.pylint.format]
max-line-length = 99

[tool.ruff]
line-length = 99

[tool.autopep8]
max_line_length = 99

[tool.isort]
line_length = 99

[tool.yapf]
column_limit = 99

setup.cfg

# Project-wide line length. Keep in sync with pyproject.toml.
[pycodestyle]
max-line-length = 99

.pre-commit-config.yaml

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v3.2.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
  # Line length only (limit comes from .flake8). Scoped to files already within
  # the limit; add files to the list as they are cleaned up.
  - repo: https://github.com/PyCQA/flake8
    rev: 7.5.0
    hooks:
      - id: flake8
        name: flake8 (line length)
        args: [--select=E501]
        files: ^(\.github/actions/jenkins-trigger/jenkins-trigger\.py|devtools/devops/jenkins\.py)$
  # Future: once the devtools/ folder is within the limit, replace the hook above
  # with this one to check every Python file under devtools/. Delete the `files:`
  # line to check every Python file in the repository instead.
  # - repo: https://github.com/PyCQA/flake8
  #   rev: 7.5.0
  #   hooks:
  #     - id: flake8
  #       name: flake8 (line length)
  #       args: [--select=E501]
  #       files: ^devtools/

Sample devtools/devops/jenkins.py coverage