diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index dda052a5..121f6573 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -34,7 +34,7 @@ jobs: node-version: 15 - name: Install production and development dependencies run: | - npm install + npm install || npm install || npm install - name: Run benchmarks run: | npm run benchmark diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6d226cbd..881e2097 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -34,7 +34,7 @@ jobs: node-version: 15 - name: Install production and development dependencies run: | - npm install + npm install || npm install || npm install - name: Run examples run: | npm run examples diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b24f0dd0..087cebda 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,9 @@ name: build # Workflow triggers: on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '30 1 * * 6' workflow_dispatch: # Workflow jobs: @@ -36,18 +39,12 @@ jobs: node-version: 15 - name: Install production and development dependencies id: install - uses: nick-invision/retry@v2 - with: - timeout_minutes: 2 - max_attempts: 3 - command: npm install + run: | + npm install || npm install || npm install - name: Run tests id: tests - uses: nick-invision/retry@v2 - with: - timeout_minutes: 3 - max_attempts: 2 - command: npm test + run: | + npm test || npm test || npm test - uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 0699d785..dfcf1023 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -21,6 +21,9 @@ name: coverage # Workflow triggers: on: + workflow_run: + workflows: ["build"] + types: [completed] workflow_dispatch: # Workflow jobs: @@ -33,17 +36,11 @@ jobs: with: node-version: 15 - name: Install production and development dependencies - uses: nick-invision/retry@v2 - with: - timeout_minutes: 2 - max_attempts: 3 - command: npm install + run: | + npm install || npm install || npm install - name: Calculate test coverage - uses: nick-invision/retry@v2 - with: - timeout_minutes: 3 - max_attempts: 2 - command: npm run test-cov + run: | + npm run test-cov || npm run test-cov || npm run test-cov - name: Upload coverage to Codecov id: upload uses: codecov/codecov-action@v1 diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index e79722e3..ed16345d 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -21,6 +21,9 @@ name: Test Installing Dependencies # Workflow triggers: on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '30 1 * * 6' workflow_run: workflows: ["Publish Package"] types: [completed] @@ -38,11 +41,8 @@ jobs: with: node-version: 15 - name: Install production dependencies via npm - uses: nick-invision/retry@v2 - with: - timeout_minutes: 2 - max_attempts: 3 - command: npm install --only=prod + run: | + npm install --only=prod || npm install --only=prod || npm install --only=prod - uses: act10ns/slack@v1 with: status: ${{ job.status }} diff --git a/base/broadcast-array/docs/types/test.ts b/base/broadcast-array/docs/types/test.ts index d25736a7..4041dc7a 100644 --- a/base/broadcast-array/docs/types/test.ts +++ b/base/broadcast-array/docs/types/test.ts @@ -70,7 +70,7 @@ function array(): ndarray { broadcastArray( ( x: number ): number => x, [ 2, 2, 2 ] ); // $ExpectError } -// The compiler throws an error if the function is not provided a second argument which is an array-like object containing array-like objects containing numbers... +// The compiler throws an error if the function is not provided a second argument which is an array-like object containing numbers... { const x = array(); diff --git a/base/serialize-meta-data/README.md b/base/serialize-meta-data/README.md index cbf51fd2..18bbd432 100644 --- a/base/serialize-meta-data/README.md +++ b/base/serialize-meta-data/README.md @@ -146,7 +146,7 @@ console.log( 'dtype (enum): %d', dtype ); // Extract the number of dimensions: var ndims = fromInt64Bytes( bytes, 1, 3 ); -console.log( 'ndims: %d', x.ndims ); +console.log( 'ndims: %d', ndims ); // Extract the shape: var shape = []; diff --git a/base/serialize-meta-data/examples/index.js b/base/serialize-meta-data/examples/index.js index 256c61ac..11345696 100644 --- a/base/serialize-meta-data/examples/index.js +++ b/base/serialize-meta-data/examples/index.js @@ -48,7 +48,7 @@ console.log( 'dtype (enum): %d', dtype ); // Extract the number of dimensions: var ndims = fromInt64Bytes( bytes, 1, 3 ); -console.log( 'ndims: %d', x.ndims ); +console.log( 'ndims: %d', ndims ); // Extract the shape: var shape = []; diff --git a/dtypes/benchmark/benchmark.js b/dtypes/benchmark/benchmark.js index 25d9ac36..b628f7b0 100644 --- a/dtypes/benchmark/benchmark.js +++ b/dtypes/benchmark/benchmark.js @@ -35,8 +35,8 @@ bench( pkg, function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { out = dtypes(); - if ( out.length !== 11 ) { - b.fail( 'should return an array of length 11' ); + if ( out.length === 0 ) { + b.fail( 'should return a non-empty array' ); } } b.toc(); diff --git a/dtypes/docs/types/tsconfig.json b/dtypes/docs/types/tsconfig.json new file mode 100644 index 00000000..a541d610 --- /dev/null +++ b/dtypes/docs/types/tsconfig.json @@ -0,0 +1,39 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "alwaysStrict": true, + "baseUrl": ".", + "charset": "utf8", + "forceConsistentCasingInFileNames": true, + "keyofStringsOnly": false, + "lib": [ + "es6" + ], + "locale": "en", + "module": "commonjs", + "moduleResolution": "node", + "newLine": "lf", + "noEmit": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": false, + "noImplicitThis": true, + "noStrictGenericChecks": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "paths": {}, + "pretty": true, + "strictBindCallApply": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "suppressExcessPropertyErrors": false, + "suppressImplicitAnyIndexErrors": false, + "typeRoots": [ "." ], + "types": [] + }, + "exclude": [ + "node_modules" + ] +} diff --git a/dtypes/docs/types/tslint.json b/dtypes/docs/types/tslint.json new file mode 100644 index 00000000..a0c360d8 --- /dev/null +++ b/dtypes/docs/types/tslint.json @@ -0,0 +1,252 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "expect": true, + "export-just-namespace": true, + "no-any-union": true, + "no-bad-reference": true, + "no-const-enum": true, + "no-dead-reference": true, + "no-declare-current-package": true, + "no-import-default-of-export-equals": true, + "no-outside-dependencies": true, + "no-padding": true, + "no-redundant-undefined": true, + "no-relative-import-in-test": false, + "no-self-import": true, + "no-single-declare-module": true, + "no-single-element-tuple-type": true, + "no-unnecessary-generics": true, + "no-useless-files": true, + "prefer-declare-function": true, + "strict-export-declare-modifiers": true, + "trim-file": true, + "unified-signatures": true, + "void-return": true, + + "adjacent-overload-signatures": true, + "ban-ts-ignore": false, + "ban-types": false, + "member-access": [ true, "no-public" ], + "member-ordering": [ true, "fields-first" ], + "no-any": false, + "no-empty-interface": true, + "no-import-side-effect": true, + "no-inferrable-types": true, + "no-internal-module": true, + "no-magic-numbers": false, + "no-namespace": true, + "no-non-null-assertion": true, + "no-parameter-reassignment": false, + "no-reference": true, + "no-unnecessary-type-assertion": true, + "no-var-requires": true, + "only-arrow-functions": false, + "prefer-for-of": false, + "promise-function-async": false, + "typedef": true, + "typedef-whitespace": [ true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "unified-signatures": true, + + "await-promise": true, + "ban-comma-operator": true, + "ban": [ true, + { + "name": [ "*", "forEach" ], + "message": "Use a regular `for` loop instead." + } + ], + "curly": true, + "forin": true, + "function-constructor": true, + "import-blacklist": [ true, "lodash" ], + "label-position": true, + "no-arg": true, + "no-bitwise": false, + "no-conditional-assignment": true, + "no-console": true, + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-duplicate-switch-case": true, + "no-duplicate-variable": [ true, "check-parameters" ], + "no-dynamic-delete": false, + "no-empty": true, + "no-eval": true, + "no-floating-promises": true, + "no-for-in-array": true, + "no-implicit-dependencies": false, + "no-inferred-empty-object-type": true, + "no-invalid-template-strings": true, + "no-invalid-this": true, + "no-misused-new": true, + "no-null-keyword": false, + "no-object-literal-type-assertion": true, + "no-return-await": true, + "no-shadowed-variable": false, + "no-sparse-arrays": true, + "no-string-literal": false, + "no-string-throw": true, + "no-submodule-imports": false, + "no-switch-case-fall-through": true, + "no-this-assignment": [ true, + { + "allowed-names": [ "^self$" ], + "allow-destructuring": true + } + ], + "no-unbound-method": [ true, "ignore-static" ], + "no-unnecessary-class": true, + "no-unsafe-any": true, + "no-unsafe-finally": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-void-expression": true, + "prefer-conditional-expression": false, + "prefer-object-spread": false, + "radix": true, + "restrict-plus-operands": true, + "strict-boolean-expressions": false, + "strict-type-predicates": true, + "switch-default": true, + "triple-equals": true, + "unnecessary-constructor": true, + "use-default-type-parameter": true, + "use-isnan": true, + + "cyclomatic-complexity": false, + "deprecation": true, + "eofline": true, + "indent": [ true, "tabs", 4 ], + "linebreak-style": [ true, "LF" ], + "max-classes-per-file": [ true, 1 ], + "max-file-line-count": [ true, 1000 ], + "max-line-length": [ true, + { + "limit": 80, + "ignore-pattern": "^import |\\/\\/ |\\/?\\* " + } + ], + "no-default-export": false, + "no-default-import": false, + "no-duplicate-imports": true, + "no-mergeable-namespace": true, + "no-require-imports": false, + "object-literal-sort-keys": false, + "prefer-const": true, + "prefer-readonly": true, + "trailing-comma": [ false, + { + "esSpecCompliant": true + } + ], + + "align": false, + "array-type": [ true, "generic" ], + "arrow-parens": true, + "arrow-return-shorthand": true, + "binary-expression-operand-order": true, + "callable-types": true, + "class-name": true, + "comment-format": [ true, "check-space" ], + "comment-type": false, + "completed-docs": true, + "encoding": true, + "file-header": false, + "file-name-casing": [ true, "snake-case" ], + "import-spacing": true, + "increment-decrement": true, + "interface-name": [ true, "never-prefix" ], + "interface-over-type-literal": true, + "jsdoc-format": false, + "match-default-export-name": false, + "newline-before-return": false, + "newline-per-chained-call": false, + "new-parens": true, + "no-angle-bracket-type-assertion": true, + "no-boolean-literal-compare": false, + "no-consecutive-blank-lines": [ true, 2 ], + "no-irregular-whitespace": true, + "no-parameter-properties": true, + "no-redundant-jsdoc": true, + "no-reference-import": true, + "no-trailing-whitespace": true, + "no-unnecessary-callback-wrapper": true, + "no-unnecessary-initializer": true, + "no-unnecessary-qualifier": true, + "number-literal-format": false, + "object-literal-key-quotes": [ true, "always" ], + "object-literal-shorthand": [ true, "never" ], + "one-line": [ true, + "check-catch", + "check-finally", + "check-else", + "check-open-brace", + "check-whitespace" + ], + "one-variable-per-declaration": true, + "ordered-imports": [ true, + { + "grouped-imports": false, + "import-sources-order": "any", + "named-imports-order": "any", + "module-source-path": "full" + } + ], + "prefer-function-over-method": [ true, "allow-public", "allow-protected" ], + "prefer-method-signature": true, + "prefer-switch": [ true, + { + "min-cases": 5 + } + ], + "prefer-template": false, + "prefer-while": true, + "quotemark": [ true, "single", "avoid-escape", "avoid-template" ], + "return-undefined": false, + "semicolon": [ true, "always" ], + "space-before-function-paren": [ true, + { + "anonymous": "always", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": [ true, 1 ], + "switch-final-break": [ true, "always" ], + "type-literal-delimiter": [ true, + { + "singleLine": "always" + } + ], + "unnecessary-bind": true, + "variable-name": [ true, "ban-keywords", "check-format" ], + "whitespace": [ true, + "check-branch", + "check-decl", + "check-operator", + "check-rest-spread", + "check-separator", + "check-type", + "check-preblock" + ] + } +}