Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

travis: optimize lint#49

Merged
thibaultrobert merged 13 commits intomasterfrom
travis-lint
Dec 5, 2019
Merged

travis: optimize lint#49
thibaultrobert merged 13 commits intomasterfrom
travis-lint

Conversation

@AurelienGasser
Copy link
Contributor

@AurelienGasser AurelienGasser commented Dec 2, 2019

1. Lint only our modules:

  • Running golint doesn't lint the errors/ package.
  • Running golint ./... lints the vendors/ package, which is wrong too.
  • => Use go list with a grep in order to lint only the packages we wrote

2. Try building the chaincode even if linting fails

Rationale: I assume it's always interesting to see if the package can build, even if linting failed.

@AurelienGasser
Copy link
Contributor Author

Running golint after go build leads to the error

chaincode:1:1: illegal character U+007F

I'll try a new approach: lint before the build, but try building even if linting fails.

@AurelienGasser
Copy link
Contributor Author

Looks like it works:

  • It caught the error in the main directory
  • It caught the error in the errors/ subdirectory
  • It still tried to go build the package
  • The CI build gets marked as "failed" out because of the lint errors

I'll remove the intentional lint errors.

@AurelienGasser AurelienGasser changed the title Travis optimize lint travis: optimize lint Dec 2, 2019
@AurelienGasser
Copy link
Contributor Author

This is ready for review.

Sorry for the noise !

@AurelienGasser
Copy link
Contributor Author

Today I learned: adding : (colon followed by a space) to a travis command makes the YAML invalid! Because : is part of the YAML syntax.

Aurélien Gasser and others added 2 commits December 2, 2019 17:30
"colon followed by space" is parsed as YAML syntax.
@thibaultrobert thibaultrobert merged commit f8ce027 into master Dec 5, 2019
@thibaultrobert thibaultrobert deleted the travis-lint branch December 5, 2019 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants