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 lint subcommand #42

Merged
merged 9 commits into from
Aug 11, 2020
Merged

Conversation

ycombinator
Copy link
Contributor

This PR implements the elastic-package lint command.

Depends on elastic/package-spec#12.
Resolves #5.

@ycombinator ycombinator requested a review from mtojek August 6, 2020 20:35
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 6, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #42 updated]

  • Start Time: 2020-08-10T19:53:06.508+0000

  • Duration: 2 min 53 sec

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

You did quite a bit of progress here! I like the fact that the source code is really simple here.

cmd/lint.go Outdated Show resolved Hide resolved
cmd/lint.go Outdated
@@ -12,11 +12,16 @@ func setupLintCommand() *cobra.Command {
Short: "Lint the integration",
Long: "Use lint command to lint the integration files.",
RunE: lintCommandAction,
SilenceUsage: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is global switch to fix these cases. Otherwise we need to mute usage for every subcommand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be possible to set SilenceUsage at the root command level, but I'm 100% sure based on this thread: spf13/cobra#340. I will try it out and update this PR accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 5ffd82d.

cmd/lint.go Outdated Show resolved Hide resolved
@mtojek
Copy link
Contributor

mtojek commented Aug 10, 2020

There was an issue spotted by CI:

[2020-08-06T21:45:00.276Z] go: github.com/elastic/package-spec/code/[email protected]: invalid version: unknown revision 000000000000

@ycombinator
Copy link
Contributor Author

There was an issue spotted by CI...

This is expected to happen until elastic/package-spec#12 gets merged.

@ycombinator
Copy link
Contributor Author

@mtojek I think I've addressed all your feedback on this PR. It's ready for your 👀 again, when you get a chance please. Thanks!

@mtojek mtojek self-requested a review August 11, 2020 07:16
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Ship it!

@ycombinator ycombinator merged commit a4d52ef into elastic:master Aug 11, 2020
@ycombinator ycombinator deleted the cmd-lint branch August 11, 2020 11:35
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.

Command: lint the integration
3 participants