Skip to content

Commit

Permalink
Fixes license headers and the linting rules (#1373)
Browse files Browse the repository at this point in the history
* Fixes the linting rules to accept only the approved copyright headers
* Fixes the license headers
  New files with no open source origins:
    * Short 2-liner block
  Modified or Unmodified files with open source origins:
    * Large header block
* Updates the snapshots that changed with updates to the license headers

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki authored Mar 25, 2022
1 parent 859e21f commit d7004dc
Show file tree
Hide file tree
Showing 7,320 changed files with 22,577 additions and 35,163 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
39 changes: 23 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,35 +28,33 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/**
* For new files created by OpenSearch Contributers
* For new files created by OpenSearch Contributors
*/
const OSD_HEADER = `
const OSD_NEW_HEADER = `
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
`;

/**
* For files that modify or use code with an exsting OSS header
* For modified and modified files with external open source code
*/
const OSS_HEADER = `
const OSD_HEADER = `
/*
* 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
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
`;

const OSS_MODIFIED_HEADER = `
const OSD_BAD_HEADER = `
/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
Expand Down Expand Up @@ -156,13 +157,14 @@ module.exports = {
'@osd/eslint/require-license-header': [
'error',
{
licenses: [OSD_HEADER, OSS_HEADER],
licenses: [OSD_NEW_HEADER, OSD_HEADER],
},
],
'@osd/eslint/disallow-license-headers': [
'error',
{
licenses: [
OSD_BAD_HEADER,
SAFER_LODASH_SET_HEADER,
SAFER_LODASH_SET_LODASH_HEADER,
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
Expand Down Expand Up @@ -198,6 +200,9 @@ module.exports = {
'error',
{
licenses: [
OSD_BAD_HEADER,
OSD_NEW_HEADER,
OSD_HEADER,
APACHE_2_0_LICENSE_HEADER,
SAFER_LODASH_SET_HEADER,
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
Expand All @@ -219,11 +224,12 @@ module.exports = {
'error',
{
licenses: [
OSS_HEADER,
OSD_BAD_HEADER,
OSD_NEW_HEADER,
OSD_HEADER,
APACHE_2_0_LICENSE_HEADER,
SAFER_LODASH_SET_LODASH_HEADER,
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
OSS_MODIFIED_HEADER,
],
},
],
Expand All @@ -242,11 +248,12 @@ module.exports = {
'error',
{
licenses: [
OSS_HEADER,
OSD_BAD_HEADER,
OSD_NEW_HEADER,
OSD_HEADER,
APACHE_2_0_LICENSE_HEADER,
SAFER_LODASH_SET_HEADER,
SAFER_LODASH_SET_LODASH_HEADER,
OSS_MODIFIED_HEADER,
],
},
],
Expand Down
8 changes: 3 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

require('./src/setup_node_env');

module.exports = function (grunt) {
Expand Down
17 changes: 14 additions & 3 deletions bwctest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

#
# 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.
#
# Any modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
#

set -e

# TODO: Update to include all known BWC of data
Expand Down Expand Up @@ -44,10 +55,10 @@ while getopts ":h:b:p:s:c:o:d:" arg; do
;;
o)
OPENSEARCH=$OPTARG
;;
;;
d)
DASHBOARDS=$OPTARG
;;
;;
:)
echo "-${OPTARG} requires an argument"
usage
Expand All @@ -74,7 +85,7 @@ if [ -z "$OPENSEARCH" ]; then
# Expected to be arch.tar.gz
DOTS="${DASH_ARR[4]}"
IFS='.' read -ra DOTS_ARR <<< "$DOTS"

VERSION="${DASH_ARR[2]}"
PLATFORM="${DASH_ARR[3]}"
ARCH="${DOTS_ARR[0]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React, { useState } from 'react';
import useMountedState from 'react-use/lib/useMountedState';
import useList from 'react-use/lib/useList';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React, { useState } from 'react';
import useMountedState from 'react-use/lib/useMountedState';
import useList from 'react-use/lib/useList';
Expand Down
8 changes: 3 additions & 5 deletions examples/bfetch_explorer/public/components/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import * as React from 'react';
import {
EuiPageBody,
Expand Down
8 changes: 3 additions & 5 deletions examples/bfetch_explorer/public/containers/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React from 'react';
import { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';
import { EuiPage } from '@elastic/eui';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import * as React from 'react';
import { EuiPanel, EuiText } from '@elastic/eui';
import { CountUntil } from '../../../../components/count_until';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import * as React from 'react';
import { EuiPanel, EuiText } from '@elastic/eui';
import { DoubleIntegers } from '../../../../components/double_integers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React from 'react';
import { EuiPageSideBar, EuiSideNav } from '@elastic/eui';
import { useHistory } from 'react-router-dom';
Expand Down
8 changes: 3 additions & 5 deletions examples/bfetch_explorer/public/hooks/use_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { useOpenSearchDashboards } from '../../../../src/plugins/opensearch_dashboards_react/public';
import { BfetchDeps } from '../mount';

Expand Down
8 changes: 3 additions & 5 deletions examples/bfetch_explorer/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import { BfetchExplorerPlugin } from './plugin';

export const plugin = () => new BfetchExplorerPlugin();
8 changes: 3 additions & 5 deletions examples/bfetch_explorer/public/mount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

/*
Expand All @@ -25,11 +28,6 @@
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import * as React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { CoreSetup, CoreStart, AppMountParameters } from 'opensearch-dashboards/public';
Expand Down
Loading

0 comments on commit d7004dc

Please sign in to comment.