Skip to content

Commit

Permalink
Turn on protolinting for snake_case
Browse files Browse the repository at this point in the history
- And fix up field names
  • Loading branch information
foot authored and erikgb committed Jan 19, 2025
1 parent 86e17a0 commit 0930748
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
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 @@ -250,8 +250,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 @@ -261,44 +261,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 @@ -314,27 +314,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 @@ -344,7 +344,7 @@ message ListFluxRuntimeObjectsResponse {

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

message ListRuntimeObjectsResponse {
Expand All @@ -353,7 +353,7 @@ message ListRuntimeObjectsResponse {
}

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

message ListFluxCrdsResponse {
Expand All @@ -362,7 +362,7 @@ message ListFluxCrdsResponse {
}

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

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

message GetObjectResponse {
Expand All @@ -384,38 +384,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 @@ -435,7 +435,7 @@ message ListNamespacesResponse {
}

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

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

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

message SyncFluxObjectResponse {
Expand All @@ -456,8 +456,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 @@ -476,26 +476,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 @@ -507,42 +507,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

0 comments on commit 0930748

Please sign in to comment.