Skip to content

adding shared ruff config, pre-commit hooks, and makefile for python linting#245

Open
sfc-gh-swalia wants to merge 1 commit into
apache:mainfrom
sfc-gh-swalia:swalia-add-python-linting
Open

adding shared ruff config, pre-commit hooks, and makefile for python linting#245
sfc-gh-swalia wants to merge 1 commit into
apache:mainfrom
sfc-gh-swalia:swalia-add-python-linting

Conversation

@sfc-gh-swalia

@sfc-gh-swalia sfc-gh-swalia commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds shared Python linting and formatting infrastructure for the project. Currently, 3 of 7 Python packages have ruff configured with inconsistent settings (different line lengths, different rule sets), while 4 packages have no linting at all. This PR establishes a single source of truth for code style, opt-in local tooling, and contributor guidance.

File added

  1. ruff.toml — shared config (line-length 120, target py311, rules: E/F/I/UP/W)
  2. .pre-commit-config.yaml — opt-in ruff hooks for local auto-formatting
  3. Makefile — make lint / make format / make format-check targets
  4. CONTRIBUTING.md — new "Development Setup" section with instructions for Python, Go, and Java
  • Does not modify or reformat any existing Python source code
  • Does not add CI enforcement (that will be a follow-up PR)
  • Does not touch Java or Go tooling
  • Discussed on dev@ossie.apache.org link

Rationale:

  1. line-length = 120: 2 of 3 existing configs already use this
  2. target-version = py311: our lowest common Python version
  3. Rules: E (pycodestyle errors), F (pyflakes - catches real bugs like unused imports, undefined names), I (isort - consistent import order), UP (pyupgrade - modernize syntax), W (warnings)
  4. E501 ignored because ruff format handles line wrapping
  5. No opinion-heavy style rules - intentionally conservative

Checklist

Documentation

  • CONTRIBUTING.md is updated if the contribution process changed

Compliance

  • ASF license headers are present on all new source files

@sfc-gh-swalia

Copy link
Copy Markdown
Contributor Author

@jbonofre @khush-bhatia Looking for your feedback!

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

Successfully merging this pull request may close these issues.

1 participant