Skip to content

Commit

Permalink
Add: eslint rule for the file header (#4126)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng authored Aug 20, 2024
1 parent 39f389f commit 3fb6c23
Show file tree
Hide file tree
Showing 1,532 changed files with 3,320 additions and 21,741 deletions.
24 changes: 23 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'plugin:react-hooks/recommended',
'plugin:vitest-globals/recommended',
],
plugins: ['react', 'react-hooks'],
plugins: ['react', 'react-hooks', 'header'],
settings: {
react: {
version: 'detect',
Expand Down Expand Up @@ -41,5 +41,27 @@ module.exports = {
],
'no-class-assign': 'off',
'no-prototype-builtins': 'off',
'header/header': [
2,
'block',
[
{
pattern: ' SPDX-FileCopyrightText: \\d{4} Greenbone AG',
template: ' SPDX-FileCopyrightText: 2024 Greenbone AG',
},
' *',
' * SPDX-License-Identifier: AGPL-3.0-or-later',
' ',
],
2,
],
},
overrides: [
{
files: ['vite-env.d.ts'],
rules: {
'header/header': 'off',
},
},
],
};
145 changes: 29 additions & 116 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
"downshift": "^9.0.6",
"eslint-plugin-header": "^3.1.1",
"fast-deep-equal": "^3.1.3",
"fast-xml-parser": "^4.2.5",
"history": "^4.10.1",
Expand Down
15 changes: 1 addition & 14 deletions src/__tests__/version.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/* Copyright (C) 2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/cancel.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2017-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import CancelToken from '../cancel.js';
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/cvss.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2019-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import {
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/gmp.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2019-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {
describe,
test,
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/gmpsettings.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {
describe,
test,
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/log.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {
describe,
test,
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/model.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import Model, {parseModelFromElement} from 'gmp/model';
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/parser.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2017-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import {isDate, isDuration} from 'gmp/models/date';
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/__tests__/timezones.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import {isArray} from '../utils/identity';
Expand Down
15 changes: 1 addition & 14 deletions src/gmp/cancel.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/* Copyright (C) 2017-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/capabilities/__tests__/capabilities.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import Capabilities from '../capabilities';
Expand Down
16 changes: 2 additions & 14 deletions src/gmp/capabilities/__tests__/everything.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
/* Copyright (C) 2018-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {describe, test, expect} from '@gsa/testing';

import EverythingCapabilities from '../everything';
Expand Down
15 changes: 1 addition & 14 deletions src/gmp/capabilities/capabilities.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/* Copyright (C) 2016-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {isDefined} from 'gmp/utils/identity';
Expand Down
15 changes: 1 addition & 14 deletions src/gmp/capabilities/everything.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/* Copyright (C) 2017-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import Capabilities from './capabilities.js';
Expand Down
15 changes: 1 addition & 14 deletions src/gmp/collection/collectioncounts.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/* Copyright (C) 2016-2022 Greenbone AG
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {isDefined} from '../utils/identity';
Expand Down
Loading

0 comments on commit 3fb6c23

Please sign in to comment.