nasa / Common-Metadata-Repository

Apache License 2.0
337 stars 92 forks source link

CMR-9902: Add linter for consistent aliases using official Clojure style guide and preliminary custom standards #2133

Closed zimzoom closed 2 months ago

zimzoom commented 2 months ago

Overview

What is the feature/fix?

Turning on linting for consistent aliases

What is the Solution?

Added a kondo linter for consistent aliases using the official Clojure style guide. Devs elected to use a custom alias for string, using 'string' instead of 'str', as it would be less confusing compared with the str native function.

A second custom alias was added for the CMR xml namespace because some areas of the codebase were aliasing it as 'xml' which is the standard alias for the native xml lib. Therefore this prevents such future collisions.

Finally, all consistent alias linting errors were fixed.

What areas of the application does this impact?

Whole codebase

Checklist

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 62.14197% with 304 lines in your changes missing coverage. Please review.

Project coverage is 57.95%. Comparing base (ea1d339) to head (074e16a). Report is 4 commits behind head on master.

Files Patch % Lines
...r/search/results_handlers/atom_results_handler.clj 0.00% 61 Missing :warning:
...r-app/src/cmr/indexer/data/concepts/collection.clj 0.00% 37 Missing :warning:
.../query_execution/facets/facets_results_feature.clj 0.00% 15 Missing :warning:
...earch-app/src/cmr/search/data/query_to_elastic.clj 0.00% 12 Missing :warning:
...ults_handlers/opendata_spatial_results_handler.clj 0.00% 12 Missing :warning:
.../cmr/search/results_handlers/provider_holdings.clj 0.00% 12 Missing :warning:
umm-spec-lib/src/cmr/umm_spec/record_generator.clj 0.00% 11 Missing :warning:
...earch/services/parameters/parameter_validation.clj 30.76% 9 Missing :warning:
...r/indexer/data/concepts/collection/data_center.clj 0.00% 8 Missing :warning:
...mr/indexer/data/concepts/collection/instrument.clj 0.00% 7 Missing :warning:
... and 56 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2133 +/- ## ======================================= Coverage 57.95% 57.95% ======================================= Files 1042 1042 Lines 70173 70171 -2 Branches 1998 1995 -3 ======================================= - Hits 40669 40668 -1 Misses 27642 27642 + Partials 1862 1861 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.