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

Added AIP number in rule register function. #330

Merged
merged 9 commits into from Nov 11, 2019
Merged

Added AIP number in rule register function. #330

merged 9 commits into from Nov 11, 2019

Conversation

mingzhi
Copy link
Contributor

@mingzhi mingzhi commented Nov 9, 2019

Rule registering now requires a valid AIP number. It removes the redundant tests in each rule package testing if a rule is in the right group.

@mingzhi mingzhi requested a review from a team November 9, 2019 20:00
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 9, 2019
@mingzhi
Copy link
Contributor Author

mingzhi commented Nov 9, 2019

This PR removes >500 lines of duplicated codes :)

@lukesneeringer
Copy link
Contributor

I think this PR would drop coverage in the rule modules below 100%, would it not?

@mingzhi
Copy link
Contributor Author

mingzhi commented Nov 9, 2019

I think this PR would drop coverage in the rule modules below 100%, would it not?

I just realized we never try to catch errors when registering a rule (see this example). In other words, AddRules must returns an error or panic.

@mingzhi
Copy link
Contributor Author

mingzhi commented Nov 9, 2019

I think this PR would drop coverage in the rule modules below 100%, would it not?

The coverage is back to 100%. But we need to fix the meta_linter.

@mingzhi
Copy link
Contributor Author

mingzhi commented Nov 10, 2019

ok  	github.com/googleapis/api-linter/rules	0.220s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0122	0.227s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0126	0.254s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0131	0.233s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0132	0.203s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0133	0.316s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0134	0.240s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0135	0.234s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0136	0.257s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0140	0.294s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0141	0.295s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0142	0.301s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0143	0.190s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0151	0.208s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0158	0.209s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0191	0.243s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0192	0.448s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/aip0203	0.315s	coverage: 97.7% of statements
ok  	github.com/googleapis/api-linter/rules/aip0231	0.311s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/internal/data	0.065s	coverage: [no statements]
ok  	github.com/googleapis/api-linter/rules/internal/testutils	0.164s	coverage: 100.0% of statements
ok  	github.com/googleapis/api-linter/rules/internal/utils	0.164s	coverage: 100.0% of statements

Copy link
Contributor

@lukesneeringer lukesneeringer left a comment

Choose a reason for hiding this comment

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

I think that the AddRules pattern may have been an error. We can always change it later, but this is an incremental improvement.

@mingzhi
Copy link
Contributor Author

mingzhi commented Nov 11, 2019

I think that the AddRules pattern may have been an error. We can always change it later, but this is an incremental improvement.

+1

@mingzhi mingzhi merged commit 694d8ae into master Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants