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

Feature: Support # comment lines in --check files #838

Merged
merged 4 commits into from Jun 19, 2023

Conversation

t-mat
Copy link
Contributor

@t-mat t-mat commented Jun 17, 2023

This PR resolves #836.

Basically, we just follow the following logic in the digest.c of GNU coreutils.
https://github.com/coreutils/coreutils/blob/d53190ed46a55f599800ebb2d8ddfe38205dbd24/src/digest.c#L1180-L1182

This PR also contains a trivial test shell script, Makefile entries and ci.yml entry for it.

This change fixes issue Cyan4973#836.

Basically, we just follow the following logic in the digest.c of GNU coreutils.
https://github.com/coreutils/coreutils/blob/d53190ed46a55f599800ebb2d8ddfe38205dbd24/src/digest.c#L1180-L1182

Note that we only allow '#' at the beginning of the line.
Add "case GetLine_comment:" to conform -Werror=switch-enum.

```
cli/xxhsum.c: In function ‘XSUM_parseFile1’:
cli/xxhsum.c:814:17: error: enumeration value ‘GetLine_comment’ not handled in switch [-Werror=switch-enum]
  814 |                 switch (XSUM_getLineResult)
      |                 ^~~~~~
```
@t-mat
Copy link
Contributor Author

t-mat commented Jun 17, 2023

tipi.build fails for some reason. I have no idea though 😿

image

Copy link
Owner

@Cyan4973 Cyan4973 left a comment

Choose a reason for hiding this comment

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

This looks all great to me !

@Cyan4973
Copy link
Owner

Cyan4973 commented Jun 19, 2023

The tipi CI test has unfortunately proven unstable several times in the past, so I don't think your code is at stake here.

That's mostly because this test downloads a container with a changing content, occasionally breaking established behavior, a symptom of an evolving experimental project.

It's probably best to remove this test from the xxhash CI suite.

@Cyan4973 Cyan4973 merged commit 34fdc93 into Cyan4973:dev Jun 19, 2023
55 of 56 checks passed
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.

Support # comment lines in --check files
2 participants