Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-423 Update license to SONAR Source-Available License v1.0 (SSALv1) #4922

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .eslint-doc-generatorrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const rules = require('./lib').rules;

/** @type {import('eslint-doc-generator').GenerateOptions} */
Expand Down
349 changes: 184 additions & 165 deletions LICENSE.txt

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ Would you like to work on this project full-time? We are hiring! Check out https

Copyright 2011-2024 SonarSource.

Licensed under the [GNU Lesser General Public License, Version 3.0](http://www.gnu.org/licenses/lgpl.txt)
SonarQube analyzers released after November 29, 2024, including patch fixes for prior versions, are published under the [Sonar Source-Available License Version 1 (SSALv1)](LICENSE.txt).

See individual files for details that specify the license applicable to each file. Files subject to the SSALv1 will be noted in their headers.
16 changes: 16 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
import esbuild from 'esbuild';
import textReplace from 'esbuild-plugin-text-replace';
import { copy } from 'esbuild-plugin-copy';
Expand Down
16 changes: 16 additions & 0 deletions generate-eslint-package-json.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
import fs from 'node:fs/promises';
import { dirname, join } from 'path';
import { fileURLToPath } from 'node:url';
Expand Down
16 changes: 16 additions & 0 deletions its/eslint8-plugin-sonarjs/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const plugin = require('eslint-plugin-sonarjs');

console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules).length} rules`);
Expand Down
16 changes: 16 additions & 0 deletions its/eslint8-plugin-sonarjs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
import plugin from 'eslint-plugin-sonarjs';

console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules).length} rules`);
Expand Down
55 changes: 43 additions & 12 deletions its/eslint8-plugin-sonarjs/index.test.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,64 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const { test } = require('node:test');
const assert = require('node:assert');
const path = require('node:path');
const spawn = require('cross-spawn');

const fixturesDir = 'fixtures';

function verifyErrors(output) {
console.log(output);
const errorLines = output.split('\n').filter(line => line.includes('error'));
assert(errorLines.length >= 8);
}

test('should work with CommonJS config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'eslint.config.cjs', 'file.js'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'eslint.config.cjs', path.join(fixturesDir, 'file.js')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});

test('should work with ECMAScript modules config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'eslint.config.mjs', 'file.js'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'eslint.config.mjs', path.join(fixturesDir, 'file.js')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});

test('should work with TSESLint config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'tseslint.config.mjs', 'file.ts'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'tseslint.config.mjs', path.join(fixturesDir, 'file.ts')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});
16 changes: 16 additions & 0 deletions its/eslint8-plugin-sonarjs/tseslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
// @ts-check

import plugin from 'eslint-plugin-sonarjs';
Expand Down
16 changes: 16 additions & 0 deletions its/eslint9-plugin-sonarjs/eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const plugin = require('eslint-plugin-sonarjs');

console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules).length} rules`);
Expand Down
16 changes: 16 additions & 0 deletions its/eslint9-plugin-sonarjs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
import plugin from 'eslint-plugin-sonarjs';

console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules).length} rules`);
Expand Down
55 changes: 43 additions & 12 deletions its/eslint9-plugin-sonarjs/index.test.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,64 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
const { test } = require('node:test');
const assert = require('node:assert');
const path = require('node:path');
const spawn = require('cross-spawn');

const fixturesDir = 'fixtures';

function verifyErrors(output) {
console.log(output);
const errorLines = output.split('\n').filter(line => line.includes('error'));
assert(errorLines.length >= 8);
}

test('should work with CommonJS config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'eslint.config.cjs', 'file.js'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'eslint.config.cjs', path.join(fixturesDir, 'file.js')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});

test('should work with ECMAScript modules config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'eslint.config.mjs', 'file.js'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'eslint.config.mjs', path.join(fixturesDir, 'file.js')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});

test('should work with TSESLint config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'tseslint.config.mjs', 'file.ts'], {
cwd: __dirname,
encoding: 'utf-8',
});
const result = spawn.sync(
'npx',
['eslint', '-c', 'tseslint.config.mjs', path.join(fixturesDir, 'file.ts')],
{
cwd: __dirname,
encoding: 'utf-8',
},
);
verifyErrors(result.stdout);
});
16 changes: 16 additions & 0 deletions its/eslint9-plugin-sonarjs/tseslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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 Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
// @ts-check

import plugin from 'eslint-plugin-sonarjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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
* Lesser General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
package org.sonar.samples.javascript.consumer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* 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
* Lesser General Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
package org.sonar.samples.javascript.consumer;

Expand Down
Loading