Skip to content

Commit

Permalink
Run precommit checks before checkstyle task (opensearch-project#3727)
Browse files Browse the repository at this point in the history
### Description

This PR runs the License Header check with the checkstyle CI check to
ensure that PRs contain licenses on top of new files. This PR also adds
the license on 2 files where its missing today.

* Category (Enhancement, New feature, Bug fix, Test fix, Refactoring,
Maintenance, Documentation)

Maintenance

### Issues Resolved

- Resolves opensearch-project#3471
- Resolves opensearch-project#3691

### Check List
- [ ] New functionality includes testing
- [ ] New functionality has been documented
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks authored Nov 17, 2023
1 parent 17748b9 commit 9be1b27
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ checkstyle {
}

tasks.withType(Checkstyle) {
dependsOn(':precommit')
reports {
ignoreFailures = false
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/opensearch/security/filter/NettyAttribute.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/

package org.opensearch.security.filter;

import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class SecurityResponse {

public SecurityResponse(final int status, final Exception e) {
this.status = status;
populateHeaders(CONTENT_TYPE_APP_JSON);
this.body = generateFailureMessage(e);
this.contentType = XContentType.JSON.mediaType();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
*/

package org.opensearch.security.filter;

import org.junit.Test;
Expand Down

0 comments on commit 9be1b27

Please sign in to comment.