Skip to content

DX: add .editorconfig and optional pre-commit hooks mirroring the ruff config #12

Closed

Description

@kstonekuan

What's missing

CONTRIBUTING.md documents a four-command quality gate (ruff check --fix, ruff format, ty check, plus the lychee link check), but contributors must remember to run it by hand, and non-Python files (YAML, Markdown) have no whitespace/end-of-line convention even though CI checks Markdown.

The repo has no .editorconfig and no .pre-commit-config.yaml. All the style decisions already exist in pyproject.toml (line-length = 100, target-version = "py311", double quotes, space indentation) — this issue is only about surfacing them to editors and git hooks.

Proposed change

  1. .editorconfig mirroring the ruff settings: UTF-8, LF line endings, final newline, trim trailing whitespace, 4-space indent for Python, max_line_length = 100; 2-space indent for YAML.
  2. .pre-commit-config.yaml running ruff check --fix and ruff format via ruff-pre-commit, pinned to the ruff version in uv.lock.
  3. A short "optional pre-commit hooks" subsection in CONTRIBUTING.md (installation is uv run pre-commit install or pipx run pre-commit install — keep it optional; CI remains the gate).

Definition of done

  • Both config files present; hook versions match the locked ruff version.
  • CONTRIBUTING.md documents the optional setup.
  • Running the hooks on the current tree produces no diff (i.e. the config matches what CI already enforces).

Validation

uv run ruff check --fix && uv run ruff format   # should be a no-op after the PR
lychee --no-progress --include-fragments \
  --exclude '^https://github\.com/Hebbian-Robotics/hflow/(issues|security/advisories/new)$' \
  --exclude-path references/mcap-spec.md \
  --exclude-path references/foxglove-CompressedVideo.proto .

Activity

  1. supercell02 commented on Aug 19, 2026

    @supercell02
    Contributor

    Hey, I’ve raised a PR addressing this issue. I’d appreciate it if you could take a look when you get a chance:

    PR: [PR Link]

  2. kstonekuan commented on Aug 19, 2026

    @kstonekuan
    ContributorAuthor

    Resolved by #15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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