Skip to content

Conversation

@mattiabaldari
Copy link
Collaborator

@mattiabaldari mattiabaldari commented Nov 26, 2025

This pull request introduces a significant update to the project's development workflow, code style enforcement, and documentation. The most important changes are the migration from flake8 to ruff for linting and formatting, the addition of pre-commit hooks and CI integration for code quality, and improvements to code style and documentation. These changes help standardize development practices, improve code readability, and ensure consistent enforcement of quality checks.

Development workflow and tooling:

  • Added .pre-commit-config.yaml to enable pre-commit hooks for linting, formatting, and various code quality checks using ruff and other tools.
  • Introduced a GitHub Actions workflow (.github/workflows/lint.yml) to run ruff linter and formatter on every push and pull request to master, ensuring CI-based code quality enforcement.
  • Added ruff.toml to configure linting and formatting rules, including target Python version, line length, exclusions, and specific rule ignores.
  • Removed .flake8 configuration, fully migrating linting responsibilities to ruff.

Documentation and setup:

  • Updated README.md with detailed development setup instructions, including cloning, installing dev dependencies, and using pre-commit and ruff for local checks.

Project metadata and dependencies:

  • Updated pyproject.toml to reflect new project ownership, repository URL, versioning, and switched optional dev dependencies from flake8 to ruff and pre-commit. Also added wheel build configuration. [1] [2]

Code style and minor refactoring:

  • Applied consistent code style improvements and minor refactors across several files (schemadiff/__init__.py, schemadiff/__main__.py, schemadiff/allow_list.py, schemadiff/changes/__init__.py), including import sorting, docstring formatting, type hinting, and argument formatting to align with modern Python best practices. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

]

[tool.hatch.build.targets.wheel]
packages = ["schemadiff"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐼 I think there should be a empty line at the bottom of this file? Do we need to setup some linting ect for this repo now we're officially forking it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair point. Since this fork is just a temporary workaround (for this change) and we expect to move back to the original repo in the mid-term, and we're also thinking about dropping the dependency in the long term, setting up the whole machinery feels a bit much for now. We should definitely do it if we end up touching more in this fork later.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense given the context which I didn't know before 👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to modify some of the metadata in this file eg the version number, author, homepage ect to avoid confusion with the forked repo

@mattiabaldari
Copy link
Collaborator Author

mattiabaldari commented Nov 26, 2025

Hey @CharlotteDodd,
I added the empty line at the end, added some linting (both locally and on github CI), modified the metadata and other things.
Probably I should also update the description of this PR now, it does much more then the initially intended.

🖊️ The last commit it's just automatic fixes from ruff.

@mattiabaldari mattiabaldari changed the title Fix installation Improve Installation Process and Resolve Setup Issues Nov 26, 2025
Copy link

@TomasBayer TomasBayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with aligning the repo to our standards, though don't think it’s strictly needed. There's also a small downside: merge conflict hell if we ever end up merging upstream changes but still need to keep the fork.

Happy for you to merge this, but also fine to stick with just the first commit and the metadata change.

pyproject.toml Outdated
description = "Compare GraphQL Schemas"
readme = "README.md"
version = "1.2.4"
version = "1.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Charlotte having fixed the cache pollution issue, we probably don't need proper versioning here if we only include this as a git dependency in theory, but probably cleaner to do it anyway. The version should increase though, as 1.0.0 might collide with an old version. Something like 1.2.4-kraken1 or so might be appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 going to use your suggestion

version = "1.0.0"
authors = [
{ name = "Nahuel Ambrosini", email = "[email protected]" }
{ name = "Mattia Baldari", email = "[email protected]" }
Copy link

@TomasBayer TomasBayer Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐼 I know it's only temporary and not really important, but you'd usually keep the original author in here. authors is a list after all 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really used to this, good you told me, didn't mean to be rude 😟

@mattiabaldari mattiabaldari force-pushed the fix-installation branch 2 times, most recently from f23cf74 to 987ff37 Compare November 27, 2025 13:41
Mattia Baldari added 6 commits November 27, 2025 15:06
Update pyproject.toml with octoenergy-specific metadata:
- Change version from 1.2.4 to 1.0.0 (fresh start for fork)
- Update author to Mattia Baldari <[email protected]>
- Update homepage URL to https://github.com/octoenergy/graphql-schema-diff/

This distinguishes the fork from the original Ambro17/graphql-schema-diff
repository and reflects octoenergy's ownership and maintenance.
- Add ruff.toml with configuration based on octoenergy/kraken-core
- Replace flake8 with ruff in dev dependencies
- Remove obsolete .flake8 configuration file
Configure pre-commit with:
- Ruff linting and formatting
- Standard checks (trailing whitespace, EOF, AST validation, etc.)

Pre-commit hooks help catch issues before committing and ensure
consistent code quality across contributors.
Add CI workflow that runs on push to master and on pull requests:
- Runs ruff linter
- Checks code formatting with ruff format

This ensures code quality checks run even for contributors who
haven't installed pre-commit hooks locally.
Add new 'Development Setup' section to README with:
- Instructions for setting up local development environment
- How to install and use pre-commit hooks
- Commands for running linting checks manually

This helps new contributors get started quickly and understand
the project's development workflow.
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.

4 participants