aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Godbolt <matt@godbolt.org>2023-02-14 07:39:13 -0600
committerGitHub <noreply@github.com>2023-02-14 07:39:13 -0600
commit586a850ff6cdf98ce91c96db13345df10f86f93a (patch)
tree8f818bf514b707e344cd6974ac648fb514f3f64e
parent7e0e955831d8958a119b899878f1bb1899867888 (diff)
parentae08b7b71eea94c08318d8fc32f17c99ea52f13d (diff)
downloadcompiler-explorer-gh-6302.tar.gz
compiler-explorer-gh-6302.zip
Merge branch 'main' into mg/tsifyAnalysisTestgh-6302
-rw-r--r--.eslintrc.yml26
-rw-r--r--lib/languages.ts2
-rw-r--r--package.json6
-rw-r--r--test/.eslintrc.yml1
-rw-r--r--test/llvm-ast-parser-tests.ts (renamed from test/llvm-ast-parser-tests.js)9
-rw-r--r--test/llvm-ir-parser-tests.ts (renamed from test/llvm-ir-parser-tests.js)12
-rw-r--r--test/llvm-pass-dump-parser-tests.ts (renamed from test/llvm-pass-dump-parser-tests.js)26
-rw-r--r--test/storage/storage-s3-tests.ts (renamed from test/storage/storage-s3-tests.js)13
-rw-r--r--test/storage/storage-tests.ts (renamed from test/storage/storage-tests.js)0
-rw-r--r--views/resources/logos/kotlin.pngbin199188 -> 0 bytes
-rw-r--r--views/resources/logos/kotlin.svg19
11 files changed, 80 insertions, 34 deletions
diff --git a/.eslintrc.yml b/.eslintrc.yml
index b5955c992..b59038d9e 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -45,15 +45,15 @@ rules:
import/newline-after-import: error
import/no-absolute-path: error
# import/no-cycle: error # disabled for now, there's an import cycle between the base-compiler and demanglers
- import/no-default-export: warn
- import/no-deprecated: warn
+ import/no-default-export: error
+ import/no-deprecated: error
import/no-mutable-exports: error
import/no-named-as-default-member: off # Far too many things (express, morgan, fs) trip this
import/no-self-import: error
import/no-useless-path-segments: error
import/no-webpack-loader-syntax: error
import/order:
- - warn
+ - error
- alphabetize:
order: asc
caseInsensitive: true
@@ -104,17 +104,17 @@ rules:
prefer-const:
- error
- destructuring: all
- jsdoc/check-alignment: warn
- jsdoc/check-param-names: warn
- jsdoc/check-syntax: warn
+ jsdoc/check-alignment: error
+ jsdoc/check-param-names: error
+ jsdoc/check-syntax: error
jsdoc/check-tag-names: off
- jsdoc/check-types: warn
- jsdoc/empty-tags: warn
- jsdoc/newline-after-description: warn
- jsdoc/require-hyphen-before-param-description: warn
- jsdoc/valid-types: warn
+ jsdoc/check-types: error
+ jsdoc/empty-tags: error
+ jsdoc/newline-after-description: error
+ jsdoc/require-hyphen-before-param-description: error
+ jsdoc/valid-types: error
no-multiple-empty-lines:
- - warn
+ - error
- max: 1
maxBOF: 0
maxEOF: 0
@@ -133,7 +133,7 @@ rules:
sonarjs/prefer-object-literal: error
sonarjs/prefer-single-boolean-return: error
sort-imports:
- - warn
+ - error
- ignoreCase: true
ignoreDeclarationSort: true
unicorn/catch-error-name: off
diff --git a/lib/languages.ts b/lib/languages.ts
index bcde44a24..c1b5275bb 100644
--- a/lib/languages.ts
+++ b/lib/languages.ts
@@ -401,7 +401,7 @@ const definitions: Record<LanguageKey, LanguageDefinition> = {
monaco: 'kotlin',
extensions: ['.kt'],
alias: [],
- logoUrl: 'kotlin.png',
+ logoUrl: 'kotlin.svg',
logoUrlDark: null,
formatter: null,
previewFilter: null,
diff --git a/package.json b/package.json
index 8833fc6b8..36ca7b7c8 100644
--- a/package.json
+++ b/package.json
@@ -172,9 +172,9 @@
"scripts": {
"ci-lint": "eslint --format github .",
"ci-test": "nyc npm run test",
- "lint": "eslint . --fix",
- "lint-check": "eslint .",
- "lint-files": "eslint",
+ "lint": "eslint --max-warnings=0 . --fix",
+ "lint-check": "eslint --max-warnings=0 .",
+ "lint-files": "eslint --max-warnings=0",
"test": "mocha -b -r ts-node/register 'test/**/*.ts' 'test/**/*.js'",
"test-min": "mocha -b --config .mocharc-min.yml",
"fix": "npm run lint && npm run format && npm run ts-check",
diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml
index 99bf3a680..68d750fa5 100644
--- a/test/.eslintrc.yml
+++ b/test/.eslintrc.yml
@@ -6,3 +6,4 @@ rules:
node/no-unpublished-import: off
unicorn/no-empty-file: off
unicorn/no-await-expression-member: off
+ '@typescript-eslint/no-non-null-assertion': off
diff --git a/test/llvm-ast-parser-tests.js b/test/llvm-ast-parser-tests.ts
index 5ff63a8b3..22aef805f 100644
--- a/test/llvm-ast-parser-tests.js
+++ b/test/llvm-ast-parser-tests.ts
@@ -1,4 +1,4 @@
-// Copyright (c) 2021, Compiler Explorer Authors
+// Copyright (c) 2023, Compiler Explorer Authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -26,6 +26,7 @@ import cloneDeep from 'lodash.clonedeep';
import {LlvmAstParser} from '../lib/llvm-ast';
import * as properties from '../lib/properties';
+import {PropertyValue} from '../lib/properties.interfaces';
import * as utils from '../lib/utils';
import {fs, should} from './utils';
@@ -48,7 +49,7 @@ describe('llvm-ast', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
astParser = new LlvmAstParser(compilerProps);
astDump = utils.splitLines(fs.readFileSync('test/ast/square.ast').toString());
@@ -115,7 +116,7 @@ describe('llvm-ast bug-3849a', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
astParser = new LlvmAstParser(compilerProps);
astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849a.ast').toString());
@@ -136,7 +137,7 @@ describe('llvm-ast bug-3849b', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
astParser = new LlvmAstParser(compilerProps);
astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849b.ast').toString());
diff --git a/test/llvm-ir-parser-tests.js b/test/llvm-ir-parser-tests.ts
index 28ef2325b..496c0d7aa 100644
--- a/test/llvm-ir-parser-tests.js
+++ b/test/llvm-ir-parser-tests.ts
@@ -1,4 +1,4 @@
-// Copyright (c) 2018, Adrian Bibby Walther
+// Copyright (c) 2023, Compiler Explorer Authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ describe('llvm-ir parseMetaNode', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmIrParser = new LlvmIrParser(compilerProps);
});
@@ -106,7 +106,7 @@ describe('llvm-ir getSourceLineNumber', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmIrParser = new LlvmIrParser(compilerProps);
});
@@ -147,7 +147,7 @@ describe('llvm-ir getSourceColumn', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmIrParser = new LlvmIrParser(compilerProps);
});
@@ -189,7 +189,7 @@ describe('llvm-ir getFileName', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmIrParser = new LlvmIrParser(compilerProps);
});
@@ -228,7 +228,7 @@ describe('llvm-ir isLineLlvmDirective', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmIrParser = new LlvmIrParser(compilerProps);
});
diff --git a/test/llvm-pass-dump-parser-tests.js b/test/llvm-pass-dump-parser-tests.ts
index 3ec5ae04c..fe406a7de 100644
--- a/test/llvm-pass-dump-parser-tests.js
+++ b/test/llvm-pass-dump-parser-tests.ts
@@ -1,3 +1,27 @@
+// Copyright (c) 2023, Compiler Explorer Authors
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
import {LlvmPassDumpParser} from '../lib/parsers/llvm-pass-dump-parser';
import * as properties from '../lib/properties';
@@ -14,7 +38,7 @@ describe('llvm-pass-dump-parser filter', function () {
before(() => {
const fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
- const compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+ const compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
});
// prettier-ignore
diff --git a/test/storage/storage-s3-tests.js b/test/storage/storage-s3-tests.ts
index 46a287066..ffb612a89 100644
--- a/test/storage/storage-s3-tests.js
+++ b/test/storage/storage-s3-tests.ts
@@ -24,24 +24,25 @@
import AWS from 'aws-sdk-mock';
+import {unwrap} from '../../lib/assert';
import * as properties from '../../lib/properties';
import {StorageS3} from '../../lib/storage';
-import {should} from '../utils';
+
+type Handler = (q: any) => any;
// NB!!! Anything using mocked AWS calls needs to be initialised in the `it(...)` block! If you initialise it in the
// `describe()` top level code then it won't be mocked in time. We only mock and de-mock before/after else we end up
// fighting over the global AWS mocking stuff. I hate mocha...there's probably a better way...
function mockerise(service, method) {
- const handlers = [];
+ const handlers: Handler[] = [];
beforeEach(() => {
AWS.mock(service, method, (q, callback) => {
- const qh = handlers.shift();
- should.exist(qh);
+ const qh = unwrap(handlers.shift());
try {
- callback(null, qh(q));
+ callback(undefined, qh(q));
} catch (e) {
- callback(e, null);
+ callback(e as any, undefined);
}
});
});
diff --git a/test/storage/storage-tests.js b/test/storage/storage-tests.ts
index 351f72292..351f72292 100644
--- a/test/storage/storage-tests.js
+++ b/test/storage/storage-tests.ts
diff --git a/views/resources/logos/kotlin.png b/views/resources/logos/kotlin.png
deleted file mode 100644
index b5515c35a..000000000
--- a/views/resources/logos/kotlin.png
+++ /dev/null
Binary files differ
diff --git a/views/resources/logos/kotlin.svg b/views/resources/logos/kotlin.svg
new file mode 100644
index 000000000..05c2515d9
--- /dev/null
+++ b/views/resources/logos/kotlin.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
+<style type="text/css">
+ .st0{fill:url(#SVGID_1_);}
+</style>
+<g id="Logotypes">
+ <g>
+
+ <linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="500.0035" y1="579.1058" x2="-9.653803e-02" y2="1079.2058" gradientTransform="matrix(0.9998 0 0 0.9998 9.651873e-02 -578.99)">
+ <stop offset="3.435144e-03" style="stop-color:#E44857"/>
+ <stop offset="0.4689" style="stop-color:#C711E1"/>
+ <stop offset="1" style="stop-color:#7F52FF"/>
+ </linearGradient>
+ <polygon class="st0" points="500,500 0,500 0,0 500,0 250,250 "/>
+ </g>
+</g>
+</svg>