Skip to content

Conversation

@aksg87
Copy link
Collaborator

@aksg87 aksg87 commented Aug 3, 2025

Description

Introduces automated code formatting and linting to ensure consistent style across LangExtract. Uses pyink (Google's Black fork), isort, and pylint following Google's Python Style Guide.

Note: This PR uses three commits instead of squashing to one because we need CI to stay green and isolating the formatting changes is useful for clarity. Can't add format checks before formatting the code (would fail), and can't format without the config first. So:

Three commits:

  1. Configuration only - Add formatter/linter configs and autoformat.sh script
  2. Apply formatting - Mechanical changes only, no functional modifications
  3. Enable CI checks - Activate format/lint environments in tox

Type: Code health

How Has This Been Tested?

$ tox  # All tests pass on Python 3.10/3.11, format and lint checks pass
$ ./autoformat.sh  # Script works correctly
$ pre-commit run --all-files  # All hooks pass

Checklist:

  • I have read and acknowledged Google's Open Source
    Code of conduct.
  • I have read the
    Contributing
    page, and I either signed the Google
    Individual CLA
    or am covered by my company's
    Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked
    issue(s) and we have agreed upon the general approach.
  • I have made any needed documentation changes, or noted in the linked
    issue(s) that documentation elsewhere needs updating.
  • I have added tests, or I have ensured existing tests cover the changes
  • I have followed
    Google's Python Style Guide
    and ran pylint over the affected code.

@aksg87 aksg87 self-assigned this Aug 3, 2025
@aksg87 aksg87 merged commit aa6da18 into main Aug 3, 2025
3 checks passed
@aksg87 aksg87 deleted the feat/code-formatting-pipeline branch August 4, 2025 01:57
aksg87 added a commit that referenced this pull request Aug 21, 2025
feat: add code formatting and linting pipeline
sinnaj referenced this pull request in sinnaj/langextract Sep 3, 2025
feat: add code formatting and linting pipeline
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