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

Move common package linter functionality to crossplane-runtime #211

Merged
merged 2 commits into from
Oct 5, 2020

Conversation

hasheddan
Copy link
Member

Description of your changes

Linter functionality has been implemented in crossplane/crossplane, but the core linter loop and helper functions can be generalized for consumption by any Linter implementer. Passed ___LinterFn that depend on crossplane/crossplane types will be kept in c/c, but will likely be moved in crossplane/crossplane#1795 to the new xpkg pkg, which is contains functionality for interacting with Crossplane packages.

This PR also renames DefaultParser to PackageParser, which is technically a breaking API change, but we have not released since this was added and it won't break downstream consumers who only invoke parser.New() then deal with the Parser interface methods.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

make test and the same functionality already exists in c/c

DefaultParser is not descriptive of the Parser implementation's purpose.
PackageParser indicates the this parser is meant for parsing packages.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@hasheddan hasheddan requested review from kasey, negz and muvaf October 3, 2020 15:07
Copy link
Member

@negz negz left a comment

Choose a reason for hiding this comment

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

One nit, but otherwise LGTM

pkg/parser/linter.go Outdated Show resolved Hide resolved
Downstream consumers may implement their own linter functions, but the
core linter loop can be generalized, as well as helper functions such as
Or.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
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.

2 participants