Skip to content

pre-commit to run fmt.sh (gofmt / gosimple / buildifier)#1818

Merged
rshriram merged 16 commits intoistio:masterfrom
jmuk:pre-commit
Nov 28, 2017
Merged

pre-commit to run fmt.sh (gofmt / gosimple / buildifier)#1818
rshriram merged 16 commits intoistio:masterfrom
jmuk:pre-commit

Conversation

@jmuk
Copy link
Copy Markdown
Contributor

@jmuk jmuk commented Nov 21, 2017

What this PR does / why we need it:

It's quite easy to forget formatting the files. This enforces to run fmt.sh, which takes care of trivial style changes on go files and BUILD files.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

none

@jmuk
Copy link
Copy Markdown
Contributor Author

jmuk commented Nov 21, 2017

/assign @ayj

@ayj
Copy link
Copy Markdown
Contributor

ayj commented Nov 21, 2017

Thanks. This enforcement is client-side which can be bypassed. Can we add the same thing to istio-presubmit here?

@jmuk
Copy link
Copy Markdown
Contributor Author

jmuk commented Nov 21, 2017

good idea, done.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 21, 2017

Codecov Report

Merging #1818 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1818      +/-   ##
==========================================
+ Coverage   81.72%   81.73%   +<.01%     
==========================================
  Files         200      203       +3     
  Lines       20330    20463     +133     
==========================================
+ Hits        16615    16725     +110     
- Misses       3251     3267      +16     
- Partials      464      471       +7
Flag Coverage Δ
#broker 45.51% <ø> (+1.06%) ⬆️
#mixer 83.31% <ø> (+0.01%) ⬆️
#pilot 80.35% <ø> (-0.06%) ⬇️
#security 90.39% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pilot/model/config.go 71.61% <ø> (ø) ⬆️
pilot/platform/kube/queue.go 82.69% <0%> (-7.7%) ⬇️
mixer/adapter/prometheus/server.go 89.83% <0%> (-5.09%) ⬇️
mixer/pkg/il/evaluator/checker.go 100% <0%> (ø)
mixer/pkg/il/evaluator/evaluator.go 84.54% <0%> (ø)
broker/pkg/version/version.go 100% <0%> (ø)
mixer/adapter/list/list.go 96.13% <0%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5741551...0517418. Read the comment docs.

WORKSPACE Outdated

mixer_adapter_repositories()

go_repository(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

btw, these things are sometimes auto-imported as part of rules_go.
https://github.com/istio/istio/blob/master/pilot/bin/check.sh#L10

@istio-merge-robot
Copy link
Copy Markdown

@jmuk PR needs rebase

@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Nov 22, 2017
@istio-merge-robot istio-merge-robot removed the needs-rebase Indicates a PR needs to be rebased before being merged label Nov 22, 2017
Copy link
Copy Markdown
Contributor

@guptasu guptasu left a comment

Choose a reason for hiding this comment

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

Thanks @jmuk this is going to be really helpful. We just need linter check after this; and we are good.

@guptasu
Copy link
Copy Markdown
Contributor

guptasu commented Nov 22, 2017

@jmuk thanks for doing this. It seems for some reason fmt.sh is not found, and that is causing the presubmit to fail.

jmuk added 2 commits November 22, 2017 10:29
The previous code causes a failure because of set -e.
@jmuk
Copy link
Copy Markdown
Contributor Author

jmuk commented Nov 22, 2017

fixed, presubmit now passes (previous fmt.sh had a bug on checking goimports / buildifier). PTAL.

@guptasu
Copy link
Copy Markdown
Contributor

guptasu commented Nov 22, 2017

/lgtm

@jmuk
Copy link
Copy Markdown
Contributor Author

jmuk commented Nov 22, 2017

/assign @sebastienvas

@istio-merge-robot
Copy link
Copy Markdown

@jmuk PR needs rebase

@istio-merge-robot istio-merge-robot added the needs-rebase Indicates a PR needs to be rebased before being merged label Nov 25, 2017
@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @ayj @guptasu @jmuk @sebastienvas

@istio-merge-robot istio-merge-robot removed lgtm needs-rebase Indicates a PR needs to be rebased before being merged labels Nov 27, 2017
@guptasu
Copy link
Copy Markdown
Contributor

guptasu commented Nov 27, 2017

/lgtm

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: guptasu
We suggest the following additional approver: sebastienvas

Assign the PR to them by writing /assign @sebastienvas in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

# Build
${ROOT}/bin/init.sh

run_or_die_on_change ./bin/fmt.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move this to line ~90 before any additional temporary build files are generated. Otherwise things like pilot/proxy/envoy/envoy will show up in git diff and incorrectly fail the build.

@istio-merge-robot
Copy link
Copy Markdown

/lgtm cancel //PR changed after LGTM, removing LGTM. @ayj @guptasu @jmuk @sebastienvas

@rshriram rshriram merged commit 6c84974 into istio:master Nov 28, 2017
kyessenov pushed a commit to kyessenov/istio that referenced this pull request Aug 13, 2018
* Update the api sha, istio/api#518.

* Remove TLS_PERMISSIVE usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants