blockedenhancementhelp wanted
Repository metrics
- Stars
- (609 stars)
- PR merge metrics
- (PR metrics pending)
Description
I was going through the codebase to see how feasible to add this feature because we currently need it.
Suggestion
I was thinking of adding an extra param [linter]_only_changed_files: boolean (we can decide on the best name to go with).
Then checking doing a quick diff of the current branch with
FILES = git diff --diff-filter=$filter --name-only $baseBranch | grep -E $extensions
where:
$filter: can be defaulted toACM(added, copied and modified), more: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203$baseBranch: we can get the base branch fromevent.pull_request.base.ref$extensions: e.g.js|.tsor we use the default extension from the lint configuration
I see you already swap branch for hasFork here: https://github.com/samuelmeuli/lint-action/blob/a820202c34156c11c68a7c534178ac66e12758b9/src/git.js#L22
We just need to do the same thing with the base repository:
- check if it's a fork, if so fetch it and add it to maybe
base-forkremote locally - else if it's not a fork, we don't need to fetch
- with the above steps, we can easily infer the base remote and branch name
Don't know if this is what you want to support @samuelmeuli else I can spin up a PR for this.
@samuelmeuli wdyt?