sk- / git-lint

improving source code one step at a time
Apache License 2.0
236 stars 78 forks source link

Run git-lint against diff of range of commits, such that it can be used in CI #110

Open emailallau opened 6 years ago

emailallau commented 6 years ago

Does git-lint works as expected for last commit changes?

emailallau commented 6 years ago

Does git-lint support running git-lint against diff of range of commits, such that it can be used in CI

sk- commented 6 years ago

Not at the moment. I'm exploring though some git recipes, with which you could uncommit (while preserving the changes) the last commits so that you can use it in a CI environment.

emailallau commented 6 years ago

Any information on the same, would be useful, appreciate your quick response.

eldamir commented 6 years ago

I'm thinking of a case where I am about do merge a feature branch back into master, and would love to be able to (og have the CI do) something like git lint master..., that is, all the commits/changes/whatever, which is in the current branch but not in master. I use the similar range often with git diff master... or git log master...

sk- commented 6 years ago

Hi @eldamir and @emailallau , I just enabled git-lint in travis CI .What I did is documented in the homepage, but is basically adding the step

git reset --soft ${TRAVIS_COMMIT_RANGE%...*} && git lint

In Circle CI something similar can be done with the environment variable CIRCLE_COMPARE_URL.

Let me know if that works for you.

eldamir commented 6 years ago

@sk- Not exactly what I had in mind, but I think it achieves the same things that I want, so thanks :)

emailallau commented 6 years ago

Yes by using git reset followed by gitlint, was able to run gitlint on entire set of changes as part of CI.

Thanks for the inputs.....:)

On Fri, Jun 1, 2018 at 1:35 PM, Ruben Nielsen notifications@github.com wrote:

@sk- https://github.com/sk- Not exactly what I had in mind, but I think it achieves the same things that I want, so thanks :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sk-/git-lint/issues/110#issuecomment-393801389, or mute the thread https://github.com/notifications/unsubscribe-auth/AIFZqHZU_40SzRDScZ6ehX_vAJv77Xfwks5t4PW5gaJpZM4SxVtE .

-- Regards, Mohd Allauddin Mob no - 9986621933