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

Add documentation for linting with a pre-commit hook #249

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

Conversation

SibiAkkash
Copy link
Contributor

No description provided.

@SibiAkkash SibiAkkash self-assigned this Dec 27, 2023
@SibiAkkash SibiAkkash marked this pull request as draft December 27, 2023 16:33
@SibiAkkash
Copy link
Contributor Author

SibiAkkash commented Dec 27, 2023

This is actually not right, there are 2 problems here

  1. Running scripts/lint would lint all the files, and not the ones staged for this particular commit (I'd have to modify the lint script to take in a subset of files)
  2. The lint script modifies the files. These files would have to be staged again before committing, ideally the hook itself takes care of restaging the modified files (if the lint script didn't fail).

If atleast 2. isn't addressed, there's no point in using the hook. I'll fix these and open pr for review again 😅

This is a good way for me to learn cmd line text processing (that's my justification for sinking time into this 👍)

@punchagan
Copy link
Member

Running scripts/lint would lint all the files, and not the ones staged for this particular commit (I'd have to modify the lint script to take in a subset of files)

The idea is to keep the linting fast enough that it's okay to run the lint on all the files, and not just modified ones. But, sure, you could run it on only the changed files.

@SibiAkkash
Copy link
Contributor Author

Running scripts/lint would lint all the files, and not the ones staged for this particular commit (I'd have to modify the lint script to take in a subset of files)

The idea is to keep the linting fast enough that it's okay to run the lint on all the files, and not just modified ones. But, sure, you could run it on only the changed files.

yeah the linting is fast, which is really nice. Point 1 might not be a problem, point 2 is the main one.

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