Fixed rubocop EntityFieldType not correcting multi-word types

What does this MR do and why?

When attempting to automatically fix EntityFieldType offenses in a new API entity, all offenses except types with 'dateTime' string were corrected. This MR updates the EntityFieldType cop to only capitalize the first letter of offending API type values instead using .capitalize on the whole string in an attempt to automatically fix them so that multi-word types are also properly auto-corrected.

How to set up and validate locally

  1. Remove 'lib/api/entities/bulk_import.rb' from the list of EntityFieldType cop exceptions
diff --git a/.rubocop_todo/api/entity_field_type.yml b/.rubocop_todo/api/entity_field_type.yml
index cce63e735b7c6c..63098e0e77a9cd 100644
--- a/.rubocop_todo/api/entity_field_type.yml
+++ b/.rubocop_todo/api/entity_field_type.yml
@@ -175,7 +175,6 @@ API/EntityFieldType:
     - 'lib/api/entities/blob.rb'
     - 'lib/api/entities/board.rb'
     - 'lib/api/entities/branch.rb'
-    - 'lib/api/entities/bulk_import.rb'
     - 'lib/api/entities/bulk_imports/entity.rb'
     - 'lib/api/entities/bulk_imports/entity_failure.rb'
     - 'lib/api/entities/bulk_imports/export_batch_status.rb'
  1. Run rubocop -A lib/api/entities/bulk_import.rb
  2. Verify all string types are capitalized, including 'dateTime'. On master, 'dateTime' would not be corrected

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sam Word

Merge request reports

Loading