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

dangling-whitespace: rule for trailing spaces #7

Merged
merged 1 commit into from
Apr 5, 2016

Conversation

vbatts
Copy link
Owner

@vbatts vbatts commented Apr 5, 2016

Signed-off-by: Vincent Batts vbatts@hashbangbash.com

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts vbatts merged commit 6e48910 into master Apr 5, 2016
@vbatts vbatts deleted the dangling-whitespace branch April 5, 2016 19:07
}

func ValidateDanglingWhitespace(c git.CommitEntry) (vr validate.Result) {
diff, err := git.Show(c["commit"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't save the diff for reuse between multiple validators, I think it would be faster (no need to serialize the whole diff) and less work in this repo (no need to parse the diff or formulate an error message) to use git show --check {commit} (like opencontainers/runtime-spec@bdaf4467e, .tools: Run git show --check ... on each commit, 2015-09-12, opencontainers/runtime-spec#182).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. I'll add a method for check and switch to that instead.

wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Apr 12, 2016
With:

  $ sed -i 's/[[:space:]]*$//' README.md

fixing some trailing whitespace that snuck in with ca0803d
(Additional language for conformance statement, 2016-04-06, opencontainers#374).
Future occurrences should be caught by git-validation, which checks
for whitespace issues since [1,2].

[1]: vbatts/git-validation#7
[2]: vbatts/git-validation#9

Signed-off-by: W. Trevor King <wking@tremily.us>
Mashimiao pushed a commit to Mashimiao/specs that referenced this pull request Aug 19, 2016
With:

  $ sed -i 's/[[:space:]]*$//' README.md

fixing some trailing whitespace that snuck in with ca0803d
(Additional language for conformance statement, 2016-04-06, opencontainers#374).
Future occurrences should be caught by git-validation, which checks
for whitespace issues since [1,2].

[1]: vbatts/git-validation#7
[2]: vbatts/git-validation#9

Signed-off-by: W. Trevor King <wking@tremily.us>
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.

None yet

2 participants