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

Turn on protolinting for snake_case #4134

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .protolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lint:
- RPC_NAMES_CASE
- FILE_HAS_COMMENT
- QUOTE_CONSISTENT
- FIELD_NAMES_LOWER_SNAKE_CASE

# The specific linters to remove.
remove:
Expand All @@ -34,6 +35,5 @@ lint:
- FIELD_NAMES_EXCLUDE_PREPOSITIONS
- FIELDS_HAVE_COMMENT
- ENUM_FIELDS_HAVE_COMMENT
- FIELD_NAMES_LOWER_SNAKE_CASE
- MESSAGE_NAMES_EXCLUDE_PREPOSITIONS
- MESSAGES_HAVE_COMMENT
108 changes: 54 additions & 54 deletions api/core/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ service Core {
// GetPolicy gets a policy by name
rpc GetPolicy(GetPolicyRequest) returns (GetPolicyResponse) {
option (google.api.http) = {
get : "/v1/policies/{policyName}"
get : "/v1/policies/{policy_name}"
};
}
/*
Expand All @@ -217,7 +217,7 @@ service Core {
rpc GetPolicyValidation(GetPolicyValidationRequest)
returns (GetPolicyValidationResponse) {
option (google.api.http) = {
get : "/v1/policyvalidations/{validationId}"
get : "/v1/policyvalidations/{validation_id}"
};
}
}
Expand All @@ -226,8 +226,8 @@ message GetInventoryRequest {
string kind = 1;
string name = 2;
string namespace = 3;
string clusterName = 4;
bool withChildren = 5;
string cluster_name = 4;
bool with_children = 5;
}

message GetInventoryResponse {
Expand All @@ -237,44 +237,44 @@ message GetInventoryResponse {
message PolicyValidation {
string id = 1;
string message = 2;
string clusterId = 3;
string cluster_id = 3;
string category = 4;
string severity = 5;
string createdAt = 6;
string created_at = 6;
string entity = 7;
string entityKind = 8;
string entity_kind = 8;
string namespace = 9;
string violatingEntity = 10;
string violating_entity = 10;
string description = 11;
string howToSolve = 12;
string how_to_solve = 12;
string name = 13;
string clusterName = 14;
string cluster_name = 14;
repeated PolicyValidationOccurrence occurrences = 15;
string policyId = 16;
string policy_id = 16;
repeated PolicyValidationParam parameters = 17;
}

message ListPolicyValidationsRequest {
string clusterName = 1;
string cluster_name = 1;
Pagination pagination = 2;
string application = 3;
string namespace = 4;
string kind = 5;
string policyId = 6;
string validationType = 7;
string policy_id = 6;
string validation_type = 7;
}

message ListPolicyValidationsResponse {
repeated PolicyValidation violations = 1;
int32 total = 2;
string nextPageToken = 3;
string next_page_token = 3;
repeated ListError errors = 4;
}

message GetPolicyValidationRequest {
string validationId = 1;
string clusterName = 2;
string validationType = 3;
string validation_id = 1;
string cluster_name = 2;
string validation_type = 3;
}

message GetPolicyValidationResponse {
Expand All @@ -290,27 +290,27 @@ message PolicyValidationParam {
string type = 2;
google.protobuf.Any value = 3;
bool required = 4;
string configRef = 5;
string config_ref = 5;
}

message PolicyParamRepeatedString {
repeated string value = 1;
}

message Pagination {
int32 pageSize = 1;
string pageToken = 2;
int32 page_size = 1;
string page_token = 2;
}

message ListError {
string clusterName = 1;
string cluster_name = 1;
string namespace = 2;
string message = 3;
}

message ListFluxRuntimeObjectsRequest {
string namespace = 1;
string clusterName = 2;
string cluster_name = 2;
}

message ListFluxRuntimeObjectsResponse {
Expand All @@ -319,7 +319,7 @@ message ListFluxRuntimeObjectsResponse {
}

message ListFluxCrdsRequest {
string clusterName = 1;
string cluster_name = 1;
}

message ListFluxCrdsResponse {
Expand All @@ -331,7 +331,7 @@ message GetObjectRequest {
string name = 1;
string namespace = 2;
string kind = 3;
string clusterName = 4;
string cluster_name = 4;
}

message GetObjectResponse {
Expand All @@ -341,38 +341,38 @@ message GetObjectResponse {
message ListObjectsRequest {
string namespace = 1;
string kind = 2;
string clusterName = 3;
string cluster_name = 3;
map<string, string> labels = 4;
}

message ClusterNamespaceList {
string clusterName = 1;
string cluster_name = 1;
repeated string namespaces = 2;
}

message ListObjectsResponse {
repeated Object objects = 1;
repeated ListError errors = 2;
repeated ClusterNamespaceList searchedNamespaces = 3;
repeated ClusterNamespaceList searched_namespaces = 3;
}

message GetReconciledObjectsRequest {
string automationName = 1;
string automation_name = 1;
string namespace = 2;
string automationKind = 3;
string automation_kind = 3;
repeated GroupVersionKind kinds = 4;
string clusterName = 5;
string cluster_name = 5;
}

message GetReconciledObjectsResponse {
repeated Object objects = 1;
}

message GetChildObjectsRequest {
GroupVersionKind groupVersionKind = 1;
GroupVersionKind group_version_kind = 1;
string namespace = 2;
string parentUid = 3;
string clusterName = 4;
string parent_uid = 3;
string cluster_name = 4;
}

message GetChildObjectsResponse {
Expand All @@ -392,7 +392,7 @@ message ListNamespacesResponse {
}

message ListEventsRequest {
ObjectRef involvedObject = 1;
ObjectRef involved_object = 1;
}

message ListEventsResponse {
Expand All @@ -401,7 +401,7 @@ message ListEventsResponse {

message SyncFluxObjectRequest {
repeated ObjectRef objects = 1;
bool withSource = 2;
bool with_source = 2;
}

message SyncFluxObjectResponse {
Expand All @@ -413,8 +413,8 @@ message GetVersionResponse {
string semver = 1;
string commit = 2;
string branch = 3;
string buildTime = 4;
string kubeVersion = 5;
string build_time = 4;
string kube_version = 5;
}

message GetFeatureFlagsRequest {}
Expand All @@ -432,26 +432,26 @@ message ToggleSuspendResourceResponse {
}

message GetSessionLogsRequest {
string sessionNamespace = 1;
string sessionId = 2;
string session_namespace = 1;
string session_id = 2;
string token = 3;
string logSourceFilter = 4;
string logLevelFilter = 5;
string log_source_filter = 4;
string log_level_filter = 5;
}

message LogEntry {
string timestamp = 1;
string source = 2;
string level = 3;
string message = 4;
string sortingKey = 5;
string sorting_key = 5;
}

message GetSessionLogsResponse {
repeated LogEntry logs = 1;
string nextToken = 2;
string next_token = 2;
string error = 3;
repeated string logSources = 4;
repeated string log_sources = 4;
}

message IsCRDAvailableRequest {
Expand All @@ -463,42 +463,42 @@ message IsCRDAvailableResponse {
}

message ListPoliciesRequest {
string clusterName = 1;
string cluster_name = 1;
Pagination pagination = 2;
}

message ListPoliciesResponse {
repeated PolicyObj policies = 1;
int32 total = 2;
string nextPageToken = 3;
string next_page_token = 3;
repeated ListError errors = 4;
}

message GetPolicyRequest {
string policyName = 1;
string clusterName = 2;
string policy_name = 1;
string cluster_name = 2;
}

message GetPolicyResponse {
PolicyObj policy = 1;
string clusterName = 2;
string cluster_name = 2;
}

message PolicyObj {
string name = 1;
string id = 2;
string code = 3;
string description = 4;
string howToSolve = 5;
string how_to_solve = 5;
string category = 6;
repeated string tags = 7;
string severity = 8;
repeated PolicyStandard standards = 9;
string gitCommit = 10;
string git_commit = 10;
repeated PolicyParam parameters = 11;
PolicyTargets targets = 12;
string createdAt = 13;
string clusterName = 14;
string created_at = 13;
string cluster_name = 14;
string tenant = 15;
repeated string modes = 16;
}
Expand Down
12 changes: 6 additions & 6 deletions api/core/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ message ObjectRef {
string kind = 1;
string name = 2;
string namespace = 3;
string clusterName = 4;
string cluster_name = 4;
}

message Condition {
Expand Down Expand Up @@ -85,14 +85,14 @@ message HealthStatus {
message InventoryEntry {
string payload = 1;
string tenant = 2;
string clusterName = 3;
string cluster_name = 3;
HealthStatus health = 4;
repeated InventoryEntry children = 5;
}

message Object {
string payload = 1;
string clusterName = 2;
string cluster_name = 2;
string tenant = 3;
string uid = 4;
repeated GroupVersionKind inventory = 5;
Expand All @@ -106,7 +106,7 @@ message Deployment {
repeated Condition conditions = 3;
repeated string images = 4;
bool suspended = 5;
string clusterName = 6;
string cluster_name = 6;
string uid = 7;
map<string, string> labels = 8;
}
Expand All @@ -119,7 +119,7 @@ message Crd {
Name name = 1;
string version = 2;
string kind = 3;
string clusterName = 4;
string cluster_name = 4;
string uid = 5;
}

Expand All @@ -128,7 +128,7 @@ message Namespace {
string status = 2;
map<string, string> annotations = 3;
map<string, string> labels = 4;
string clusterName = 5;
string cluster_name = 5;
}

message Event {
Expand Down
Loading
Loading