-
Notifications
You must be signed in to change notification settings - Fork 996
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
Add Format and Lint to Makefile #545
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a0cfb13
Add Make commands for format, lint, flake8, spotless, isort, black, a…
woop 3c9b927
Add mypy test
woop 210d11f
Add lint tests to CI
woop a6ae958
Fix broken Python test
woop cbafe55
Fix broken test for Python
woop bc3e3a5
Add black to dependencies
woop 876ef52
Remove Python Protos
woop a4de6ab
Add automatic local linting
woop 8e3f33b
Update precommit names
woop 96745f8
Add black exclusions
woop 793f99e
Add tensorflow metadata proto generation
woop 22a6ddd
Ignore tf meta directory
woop ce25d8e
Add build essentials to install make in CI
woop fc5e547
Add exports back to __init__.py
woop 225a048
Add __all__ to export
woop 7b72511
Add white space to export
woop cc00fec
Add source to export
woop 91eaa18
Fix python export formatting
woop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: format | ||
name: Format | ||
stages: [commit] | ||
language: system | ||
entry: make format | ||
- id: lint | ||
name: Lint | ||
stages: [commit] | ||
language: system | ||
entry: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
set -o pipefail | ||
|
||
make lint-go | ||
|
||
cd sdk/go | ||
go test -v 2>&1 | tee /tmp/test_output | ||
TEST_EXIT_CODE=$? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If my version of
golint
is still current, it requires a flag-set_exit_status
in order to return an error status to the shell.A formatting check should probably be included in
lint-go
as well, it is for the other languages.gofmt
has no such feature at all to return an error exit status, the idiom seems to be to usetest -z $(gofmt -l ./)
when this is desired.I'm not sure if we're actually wanting it to fail on CI yet, because of the desire to not fail lint checks one-at-a-time, but we probably want to be consistent about whether all the
lint-*
make targets exit nonzero when there's an issue (I haven't checked behavior of all others yet).Probably
lint-go
will not fail CI for now even if this target is updated to exit nonzero, because.prow/scripts/test-golang-sdk.sh
does notset -e
.