fix(spotless): Exclude generated code from spotless #15104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Spotless is configured to work on generated code in the repo. This seems unnecesary and makes the spotlessCheck and spotlessApply take long to run.
This PR successfully eliminates unnecessary code generation from the
spotlessChecktask, resulting in a 93.5% reduction in execution time (from 1m 33s to 6s).Performance Metrics
Key Changes Eliminated
Code Generation Tasks No Longer Triggered
The following expensive code generation tasks no longer run during
spotlessCheck::metadata-models:generateDataTemplate- Processing 610 schema files:metadata-models:generateAvroSchema- Processing 610 schema files:metadata-models:generateJsonSchema- JSON schema generation:metadata-models:openApiGenerate- OpenAPI code generation:metadata-models:compileMainGeneratedDataTemplateJava- Compiling generated code:datahub-graphql-core:graphqlCodegen- Generating 1079 GraphQL classes:metadata-service:openapi-analytics-servlet:openApiGenerate:metadata-service:openapi-entity-servlet:openApiGenerateChanges Made
spotlessJava.dependsOnon generation tasks in:Result
✅
spotlessChecknow runs only on actual source files and does not trigger any code generation pipelines, making the development workflow significantly faster for code quality checks.