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

[FLINK-37600] Add pre-commit git hook for common linting checks #26386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomncooper
Copy link
Contributor

What is the purpose of the change

There are several linting checks contained within the github actions pre-compile workflow.

It would be useful to have these checks run as a pre-commit hook in git so that any linting issues are spotted before they are pushed remotely.

This PR contains an example pre-commit git hook script in the new tools/git-hooks directory with instructions on how to symlink the script to the developers local .git/hooks directory.

This hook is entirely optional and once added can be skipped with the --no-verify flag.

Brief change log

  • Add example pre-commit git hub script in the new tools/git-hooks directory.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 1, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@tomncooper tomncooper changed the title Add pre-commit git hook for common linting checks [FLINK-37600] Add pre-commit git hook for common linting checks Apr 2, 2025
@davidradl
Copy link
Contributor

As per this weeks CHI meeting with @tomncooper, it would be good to decide what the server side implementation should be for checking pre commits, at the same time as proposing the client linting, so we can ensure that the checks are not duplicated and there is one golden version of checks.

The server side could drive the Git hooks using Git Actions.

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.

3 participants