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

Implement -check flag and exit codes #29

Merged
merged 2 commits into from
Feb 22, 2020
Merged

Implement -check flag and exit codes #29

merged 2 commits into from
Feb 22, 2020

Conversation

mithun
Copy link
Contributor

@mithun mithun commented Jan 29, 2020

Closes #28

Copy link
Contributor

@x1ddos x1ddos left a comment

Choose a reason for hiding this comment

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

Please let's revert changes to travis CI config, go.mod and go.sum. They are good changes but they are out of scope here and should be sent in a separate PR.

It just makes it so much easier to review a change when it isn't cluttered with unrelated modifications.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@mithun
Copy link
Contributor Author

mithun commented Feb 3, 2020

@x1ddos I'll review the recommended changes. However, the implementation requires the ability to handle errors in waitgroups, hence the change to errgroup which then requires changes to travis-ci, go.mod, etc. Should this PR then be split into 2 (one for error handling, another for the -check flag implementation)?

@mithun mithun requested a review from x1ddos February 3, 2020 12:52
The program now exits with a non-zero code when errors are encountered
while reading and/or writing files.

This now also introduces Go Modules for dependency management
@mithun
Copy link
Contributor Author

mithun commented Feb 12, 2020

@x1ddos I've updated the PR with recommended changes.

Note that changes to travis CI config, go.mod, and go.sum are part of this PR since they are required for PR tests to pass.

@x1ddos
Copy link
Contributor

x1ddos commented Feb 17, 2020

Sorry, got distracted by other things. Let me take a look.

main.go Outdated Show resolved Hide resolved
When this flag is used:

* The program never modifies any files
* If all files in the pattern contain a license, the program exits with
a zero exit code
* If at least one file in the pattern requires modification to include
license text, the program prints such files to STDOUT and exits with
a non-zero exit code
@mithun mithun requested a review from x1ddos February 18, 2020 13:55
Copy link
Contributor

@x1ddos x1ddos left a comment

Choose a reason for hiding this comment

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

Thanks!

@x1ddos x1ddos merged commit 3db4982 into google:master Feb 22, 2020
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.

Option to list files that will be modified
2 participants