Should RuboCop check low-level files (GAPIC and associated)? - Ruby google-cloud-ruby
I believe that the RuboCop configuration files for all packages containing GAPIC code exclude that code from analysis. Recently, a question about style came up in a PR adding GAPIC code. Should this code be covered by RuboCop?
Updating these files to pass RuboCop analysis could require significant work. For example, if I remove the following lines from
- "lib/google/logging/**/*" - "lib/google/cloud/logging/v2.rb" - "lib/google/cloud/logging/v2/**/*"
The result is
285 offenses detected:
Running RuboCop... /Users/quartzmo/code/google/codez/gcloud-ruby/google-cloud-logging/.rubocop.yml: Style/RescueException has the wrong namespace - should be Lint Inspecting 42 files ...................CCCCCCCCCCCC...CCCCCCC. Offenses: lib/google/cloud/logging/v2/config_service_v2_api.rb:35:81: C: Line is too long. [86/80] # Service for configuring sinks used to export log entries outside Stackdriver ^^^^^^ lib/google/cloud/logging/v2/config_service_v2_api.rb:62:81: C: Line is too long. [81/80] # The scopes needed to make gRPC calls to all of the methods defined in ^ lib/google/cloud/logging/v2/config_service_v2_api.rb:89:15: C: Use the new Ruby 1.9 hash syntax. :"project" => project ^^^^^^^^^^^^^ lib/google/cloud/logging/v2/config_service_v2_api.rb:89:15: C: Do not use strings for word-like symbol literals. ... lib/google/logging/v2/logging_services_pb.rb:46:81: C: Line is too long. [130/80] rpc :ListMonitoredResourceDescriptors, ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 42 files inspected, 285 offenses detected RuboCop failed!
I think the generate protobuf classes should remain exempt from rubocop linting, because the protobuf ruby compiler is an independent project of its own.
The GAPIC generated code could probably benefit from some simple linting, like the missing new line at end of file. But I'm not sure how feasible it is to fix all the other NITs. Especially GAPIC generated code has to deal with the super long protobuf classes. (cc @swcloud) I'm wonder if it's possible to have two sets of rubocop style definitions coexist. A stricter style for hand written code, and a simpler style for generated GAPIC code.
- quarkus Cannot transform *class as its containing application archive could not be found - Java
- Add support for font-stretch descriptor - vivliostyle.js
- Violation: requireNativeComponent: "RNCSafeAreaView" was not found in the UIManager. - TypeScript react-native-safe-area-context
- How to integrate with pyechart? thanks. - flexx
- Widgets: Add numbered rankings to Top Posts and Pages widget - jetpack
- Azure Virtual Desktop - local Drive re-direction - PowerShell azure-docs
- sentencepiece Chinese comma '，' is converted to Latin comma ',' - Cplusplus