Skip to content

dev: pre-commit hook to standardize toml format#2186

Merged
Qazalbash merged 1 commit into
masterfrom
tombi-pre-commit
May 13, 2026
Merged

dev: pre-commit hook to standardize toml format#2186
Qazalbash merged 1 commit into
masterfrom
tombi-pre-commit

Conversation

@Qazalbash
Copy link
Copy Markdown
Collaborator

This PR introduces a pre-commit hook of tombi to standardize the toml format.

@Qazalbash Qazalbash requested review from fehiepsi and juanitorduz May 7, 2026 12:01
Copy link
Copy Markdown
Collaborator

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

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

:)

@juanitorduz
Copy link
Copy Markdown
Collaborator

juanitorduz commented May 7, 2026

Do you also wanna check this in make lint and make format?

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

Do you also wanna check this in make lint and make format?

Good idea 😄

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

To: @juanitorduz @fehiepsi

Do you also wanna check this in make lint and make format?

I have another proposal in mind.

Currently, we have pre-commit hooks configured for:

  • ruff format
  • ruff check
  • ty check
  • mypy

These checks are also included in make lint, which is why we skip them in CI whenever prek is instantiated.

Given this setup, would it make sense to consolidate the workflow and reduce the maintenance overhead by relying on a single entry point? If prek run -a is capable of handling all formatting, linting, and related checks consistently, we may no longer need separate make lint and make format targets.

What are your thoughts on this approach?

@juanitorduz
Copy link
Copy Markdown
Collaborator

I agree! In most of my other projects, I simply use https://github.com/pre-commit/action :)

@fehiepsi
Copy link
Copy Markdown
Member

fehiepsi commented May 7, 2026

What's the setup that makes it easier to contribute without having to worry about toml/ty etc. dependency? I think we want to have minimal requirement for formatting. The rest is optional.

@juanitorduz
Copy link
Copy Markdown
Collaborator

What's the setup that makes it easier to contribute without having to worry about toml/ty etc. dependency? I think we want to have a minimal requirement for formatting. The rest is optional.

I personally do not think there is an absolute best way, and its more about opinions XD

My preference (this is an opinion, not a fact) is towards pre-commit hooks. Again, no strong preferences and the Make command also works fine.

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

I personally do not think there is an absolute best way, and its more about opinions XD

I agree.

What's the setup that makes it easier to contribute without having to worry about toml/ty etc. dependency?

In my opinion, pre-commit hooks are the better approach. We only need to install pre-commit/prek, and it can manage all additional dependencies automatically. The only maintenance overhead is periodically updating the hooks to their latest versions, which can also be automated using a GitHub bot.

@juanitorduz
Copy link
Copy Markdown
Collaborator

This is a great point! We have pre-commit update PRs as pymc-labs/pymc-marketing#2506

It needs minimal configuration:

https://github.com/pymc-labs/pymc-marketing/blob/e1eb8a32e8cba48e580ff36032e9715f99c97fed/.pre-commit-config.yaml#L1-L2

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

@juanitorduz @fehiepsi should we merge this PR? 😄

@fehiepsi
Copy link
Copy Markdown
Member

fehiepsi commented May 12, 2026

I guess so. Just to confirm, do I need to install all those hooks for the dev workflow? All I want is to use ruff to format the scripts and make a commit without worrying about those .pre-commit-config.yaml‎ configurations, which I'm not familiar with.

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

No, you don't have to worry about hooks. All you need is to install pre-commit/prek (once) and then run them every time you want these hooks to run. pre-commit/prek will automatically install and manage those hooks leaving no responsibility on dev.

@Qazalbash Qazalbash merged commit 8d1511e into master May 13, 2026
9 checks passed
@Qazalbash Qazalbash deleted the tombi-pre-commit branch May 13, 2026 06:53
@fehiepsi
Copy link
Copy Markdown
Member

fehiepsi commented May 13, 2026

If I don't install those prek/pre-commit tools, would that be fine? If they are needed, how can I bypass them? I don't want those things block my workflow.

@fehiepsi
Copy link
Copy Markdown
Member

I don't care much about how useful they are, even if things are automatic.

@Qazalbash
Copy link
Copy Markdown
Collaborator Author

No, they are not that necessary. You can bypass them.

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