Skip to content

[chore] catch styling bugs in the prs better.#321

Open
sayakpaul wants to merge 18 commits intomainfrom
refactor-styling-workflow
Open

[chore] catch styling bugs in the prs better.#321
sayakpaul wants to merge 18 commits intomainfrom
refactor-styling-workflow

Conversation

@sayakpaul
Copy link
Member

Currently, our CI doesn't properly catch the styling issues despite having the lint.yml workflow. This PR fixes that.

Additionally, this PR:

  • Introduces a quality command in the Makefile. So, when developers run make style && make quality, they know that the CI will be through with this.
  • Enforces styling checks to pass first before running the test_kernels.yml workflow.

@sayakpaul sayakpaul requested a review from danieldk March 10, 2026 05:07
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

build_toml = kernel_dir / "build.toml"
build_toml.write_text(
"""[general]
build_toml.write_text("""[general]
Copy link
Member Author

@sayakpaul sayakpaul Mar 10, 2026

Choose a reason for hiding this comment

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

Result of make style.

We could consider fixing the black version (same for isort and ruff) but I don't think it's a big deal.

@sayakpaul
Copy link
Member Author

Doesn't look like we have update_python_depends.py?

@sayakpaul
Copy link
Member Author

@danieldk a friendly ping on this one as well.

uv run black --check kernels
run: uv run --with black black --check kernels/src kernels/tests

validate-dependencies:
Copy link
Member

Choose a reason for hiding this comment

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

The dependency validation gets removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed it because update_python_depends.py (the script this step uses) is missing.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right. But we should still check that the files are the same in the Rust crate and the Python packages (ideally we'd only have one file, but both don't deal well with out-of-tree files).

Copy link
Member

Choose a reason for hiding this comment

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

I think something like cmp -s file1 file2 should do the trick, since it returns exit code != 0 when the files differ.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do the latest changes work for you? 👀

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.

3 participants