Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

remove spotless header file; remove copyright year in new files for h… #372

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

ylwu-amzn
Copy link
Contributor

@ylwu-amzn ylwu-amzn commented Jan 26, 2021

…istorical detector

Description of changes:

1.Remove copyright year in new files for historical detector
2.Remove hard code spotless header file.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #372 (e45fd4d) into master (f40e9b8) will decrease coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #372      +/-   ##
============================================
- Coverage     79.00%   78.93%   -0.08%     
+ Complexity     2657     2653       -4     
============================================
  Files           247      247              
  Lines         11719    11719              
  Branches       1009     1009              
============================================
- Hits           9259     9250       -9     
- Misses         1986     1992       +6     
- Partials        474      477       +3     
Flag Coverage Δ Complexity Δ
cli 79.27% <ø> (ø) 0.00 <ø> (ø)
plugin 78.90% <ø> (-0.09%) 0.00 <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
.../ad/common/exception/ADTaskCancelledException.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
...ch/ad/common/exception/DuplicateTaskException.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...on/opendistroforelasticsearch/ad/model/ADTask.java 96.56% <ø> (-1.57%) 66.00 <0.00> (-2.00)
...ndistroforelasticsearch/ad/model/ADTaskAction.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...distroforelasticsearch/ad/model/ADTaskProfile.java 40.00% <ø> (ø) 13.00 <0.00> (ø)
...endistroforelasticsearch/ad/model/ADTaskState.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...pendistroforelasticsearch/ad/model/ADTaskType.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...forelasticsearch/ad/model/AnomalyDetectorType.java 100.00% <ø> (ø) 1.00 <0.00> (ø)
...oforelasticsearch/ad/model/DetectionDateRange.java 100.00% <ø> (ø) 14.00 <0.00> (ø)
...elasticsearch/ad/rest/RestSearchADTasksAction.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
... and 34 more

@@ -451,7 +451,6 @@ spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
licenseHeaderFile 'spotless.license.java'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this mean we would not mandate the license header for new files?
Can't we just remove the year?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license header is still mandatory. If license header is missing, can't pass gradle build.
From Aloitta, we can remove copyright header for new files and keep old files as is. So I just removed copyright year in new files for AD historical detector in this PR. We can't specify a license header file without copyright year, otherwise the old files which has copyright year will fail gradle build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks. I guess AD Kibana should follow the same standard.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created AD Kibana issue here. @ylwu-amzn is confirming on whether or not to change all older files to the new non-year format as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks @ylwu-amzn !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is confirmed to leave the older files as they exist. Changes should only be made based on recently-created files (like historical-detector related code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Alolita, “the open source community is used to having older formats in older code” we should not remove copyright year from old files. So we will just remove copyright year in new files from 2021

@@ -451,7 +451,6 @@ spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
licenseHeaderFile 'spotless.license.java'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks. I guess AD Kibana should follow the same standard.

@ylwu-amzn ylwu-amzn merged commit 852c2af into opendistro-for-elasticsearch:master Jan 26, 2021
@ohltyler ohltyler added the documentation Improvements or additions to documentation label Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants