Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM Added Black formatting check action for GitHub #363

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianmkenney
Copy link
Contributor

I've added a basic format checking action (using Black). This is somewhat related to #291, but this PR is for a GitHub action versus local commit hooks that are managing more than just formatting.

The addition of pre-commit-config.yaml in the PR linked above only appears useful locally, but I assume the plan is to hook into https://pre-commit.ci/ at some point since expecting new developers to always remember to install the hooks is unrealistic and thus unenforceable without checks like the one added in this PR.

Generally, I'm in favor of keeping external services to a minimum, with particular emphasis on those that write commits. Alternatively, we can add individual actions for each check. It might instead make sense to maintain an OpenFreeEnergy Python package action that is easy to include in any new Python projects.

I'm setting this as DNM for now to give time for discussion. Thoughts @IAlibay @mikemhenry @dotsdl? Please ping others if you think they'd be interested!

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (e57f300) to head (dce30f0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #363   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files          36       36           
  Lines        2049     2049           
=======================================
  Hits         2023     2023           
  Misses         26       26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ianmkenney ianmkenney linked an issue Oct 15, 2024 that may be closed by this pull request
@mattwthompson
Copy link
Contributor

mattwthompson commented Oct 16, 2024

Not a stakeholder but IME https://pre-commit.ci/ has been better than a separate action

  • Lightning quick (even quicker when the linters using Rust tools instead of those written in pure Python!), generally completing before I've navigated from my terminal to the web page
  • Keeps all configs in one place - for all humans and all robots
  • No/minimal config separate from what's used to run checks locally
  • Changes are only introduced when the config changes, whereas a pip install black reliably breaks once or more times a year and/or requires human updates
  • Automatically updates (with control over frequency)
  • Can easily "attribute" linting diffs to a bot

@IAlibay
Copy link
Member

IAlibay commented Oct 16, 2024

We should discuss this at the next gufe meeting - I suspect whatever approach we take here is something we will want to enforce across the ecosystem.

To be honest I increasingly start to take @ianmkenney's stance here - precommit's workflow often gets in my way / leads to unecessary commits. I will go with the majority, but I like the cleanliness of a black action just telling me off on diff.

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

Successfully merging this pull request may close these issues.

Add black check for PRs?
3 participants