mirror of
https://github.com/github/codeql-action.git
synced 2025-12-25 00:30:08 +08:00
Compare commits
28 Commits
henrymerce
...
codeql-bun
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9a7c6738f | ||
|
|
31b9dd18d4 | ||
|
|
7e2f56aae3 | ||
|
|
878ae4a749 | ||
|
|
63602c0f72 | ||
|
|
66dc883276 | ||
|
|
2203178090 | ||
|
|
0ff6cfb53c | ||
|
|
f128379387 | ||
|
|
1f63aba653 | ||
|
|
a98b9bd46b | ||
|
|
49e0fc2ba1 | ||
|
|
2192e3432b | ||
|
|
1b6e91df31 | ||
|
|
c32aadf8fd | ||
|
|
7d646d3301 | ||
|
|
7b79062de0 | ||
|
|
61cdd2503b | ||
|
|
92c848eb82 | ||
|
|
f93fb8df6e | ||
|
|
eea148f0e6 | ||
|
|
34090feb56 | ||
|
|
976ada262f | ||
|
|
c946707707 | ||
|
|
4f6104c444 | ||
|
|
a27d3e9355 | ||
|
|
cae6b78afc | ||
|
|
097823f389 |
12
.github/actions/prepare-test/action.yml
vendored
12
.github/actions/prepare-test/action.yml
vendored
@@ -2,8 +2,12 @@ name: "Prepare test"
|
||||
description: Performs some preparation to run tests
|
||||
inputs:
|
||||
version:
|
||||
description: "The version of the CodeQL CLI to use. Can be 'latest', 'cached', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
|
||||
description: "The version of the CodeQL CLI to use. Can be 'latest', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
|
||||
required: true
|
||||
use-all-platform-bundle:
|
||||
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
|
||||
default: 'false'
|
||||
required: false
|
||||
outputs:
|
||||
tools-url:
|
||||
description: "The value that should be passed as the 'tools' input of the 'init' step."
|
||||
@@ -24,7 +28,9 @@ runs:
|
||||
run: |
|
||||
set -e # Fail this Action if `gh release list` fails.
|
||||
|
||||
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
||||
if [[ ${{ inputs.use-all-platform-bundle }} == "true" ]]; then
|
||||
artifact_name="codeql-bundle.tar.gz"
|
||||
elif [[ "$RUNNER_OS" == "Linux" ]]; then
|
||||
artifact_name="codeql-bundle-linux64.tar.gz"
|
||||
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||
artifact_name="codeql-bundle-osx64.tar.gz"
|
||||
@@ -46,7 +52,7 @@ runs:
|
||||
echo "tools-url=https://github.com/github/codeql-action/releases/download/codeql-bundle-$version/$artifact_name" >> $GITHUB_OUTPUT
|
||||
elif [[ ${{ inputs.version }} == "latest" ]]; then
|
||||
echo "tools-url=latest" >> $GITHUB_OUTPUT
|
||||
elif [[ ${{ inputs.version }} == "cached" ]]; then
|
||||
elif [[ ${{ inputs.version }} == "default" ]]; then
|
||||
echo "tools-url=" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "::error::Unrecognized version specified!"
|
||||
|
||||
15
.github/actions/setup-swift/action.yml
vendored
15
.github/actions/setup-swift/action.yml
vendored
@@ -1,5 +1,5 @@
|
||||
name: "Set up Swift"
|
||||
description: Sets up an appropriate Swift version if supported on this platform.
|
||||
name: "Set up Swift on Linux"
|
||||
description: Sets up an appropriate Swift version on Linux.
|
||||
inputs:
|
||||
codeql-path:
|
||||
description: Path to the CodeQL CLI executable.
|
||||
@@ -9,21 +9,16 @@ runs:
|
||||
steps:
|
||||
- name: Get Swift version
|
||||
id: get_swift_version
|
||||
if: runner.os != 'Windows'
|
||||
if: runner.os == 'Linux'
|
||||
shell: bash
|
||||
env:
|
||||
CODEQL_PATH: ${{ inputs.codeql-path }}
|
||||
run: |
|
||||
if [[ $RUNNER_OS = "macOS" ]]; then
|
||||
PLATFORM="osx64"
|
||||
else # We do not run this step on Windows.
|
||||
PLATFORM="linux64"
|
||||
fi
|
||||
SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')"
|
||||
if [ $SWIFT_EXTRACTOR_DIR = "null" ]; then
|
||||
VERSION="null"
|
||||
else
|
||||
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
|
||||
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/linux64/extractor" --version | awk '/version/ { print $3 }')"
|
||||
# Specify 5.x.0, otherwise setup Action will default to latest minor version.
|
||||
if [ $VERSION = "5.7" ]; then
|
||||
VERSION="5.7.0"
|
||||
@@ -37,6 +32,6 @@ runs:
|
||||
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT
|
||||
|
||||
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test.
|
||||
if: runner.os != 'Windows' && steps.get_swift_version.outputs.version != 'null'
|
||||
if: runner.os == 'Linux' && steps.get_swift_version.outputs.version != 'null'
|
||||
with:
|
||||
swift-version: "${{ steps.get_swift_version.outputs.version }}"
|
||||
|
||||
67
.github/workflows/__all-platform-bundle.yml
generated
vendored
Normal file
67
.github/workflows/__all-platform-bundle.yml
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
# Warning: This file is generated automatically, and should not be modified.
|
||||
# Instead, please modify the template in the pr-checks directory and run:
|
||||
# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py)
|
||||
# to regenerate this file.
|
||||
|
||||
name: PR Check - All-platform bundle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v2
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
all-platform-bundle:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: All-platform bundle
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'true'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
matrix.version == '20220908' ||
|
||||
matrix.version == '20221211'
|
||||
)
|
||||
shell: bash
|
||||
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
|
||||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
with:
|
||||
upload-database: false
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
7
.github/workflows/__analyze-ref-input.yml
generated
vendored
7
.github/workflows/__analyze-ref-input.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__autobuild-action.yml
generated
vendored
1
.github/workflows/__autobuild-action.yml
generated
vendored
@@ -45,6 +45,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__config-export.yml
generated
vendored
1
.github/workflows/__config-export.yml
generated
vendored
@@ -51,6 +51,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__diagnostics-export.yml
generated
vendored
1
.github/workflows/__diagnostics-export.yml
generated
vendored
@@ -57,6 +57,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
3
.github/workflows/__export-file-baseline-information.yml
generated
vendored
3
.github/workflows/__export-file-baseline-information.yml
generated
vendored
@@ -45,6 +45,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
@@ -62,7 +63,7 @@ jobs:
|
||||
CODEQL_FILE_BASELINE_INFORMATION: true
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{steps.init.outputs.codeql-path}}
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
|
||||
1
.github/workflows/__extractor-ram-threads.yml
generated
vendored
1
.github/workflows/__extractor-ram-threads.yml
generated
vendored
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__go-custom-queries.yml
generated
vendored
7
.github/workflows/__go-custom-queries.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
5
.github/workflows/__go-tracing-autobuilder.yml
generated
vendored
@@ -42,9 +42,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -67,6 +67,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
5
.github/workflows/__go-tracing-custom-build-steps.yml
generated
vendored
@@ -42,9 +42,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -67,6 +67,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
5
.github/workflows/__go-tracing-legacy-workflow.yml
generated
vendored
@@ -42,9 +42,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -67,6 +67,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__init-with-registries.yml
generated
vendored
7
.github/workflows/__init-with-registries.yml
generated
vendored
@@ -26,11 +26,11 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -58,6 +58,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
3
.github/workflows/__javascript-source-root.yml
generated
vendored
3
.github/workflows/__javascript-source-root.yml
generated
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: Custom source root
|
||||
@@ -45,6 +45,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__ml-powered-queries.yml
generated
vendored
7
.github/workflows/__ml-powered-queries.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__multi-language-autodetect.yml
generated
vendored
5
.github/workflows/__multi-language-autodetect.yml
generated
vendored
@@ -42,9 +42,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -67,6 +67,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
7
.github/workflows/__packaging-codescanning-config-inputs-js.yml
generated
vendored
@@ -32,11 +32,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -57,6 +57,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
7
.github/workflows/__packaging-config-inputs-js.yml
generated
vendored
@@ -32,11 +32,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -57,6 +57,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__packaging-config-js.yml
generated
vendored
7
.github/workflows/__packaging-config-js.yml
generated
vendored
@@ -32,11 +32,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -57,6 +57,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__packaging-inputs-js.yml
generated
vendored
7
.github/workflows/__packaging-inputs-js.yml
generated
vendored
@@ -32,11 +32,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -57,6 +57,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__remote-config.yml
generated
vendored
7
.github/workflows/__remote-config.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__resolve-environment-action.yml
generated
vendored
1
.github/workflows/__resolve-environment-action.yml
generated
vendored
@@ -45,6 +45,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
3
.github/workflows/__rubocop-multi-language.yml
generated
vendored
3
.github/workflows/__rubocop-multi-language.yml
generated
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
name: RuboCop multi-language
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__ruby.yml
generated
vendored
5
.github/workflows/__ruby.yml
generated
vendored
@@ -30,9 +30,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
5
.github/workflows/__scaling-reserved-ram.yml
generated
vendored
@@ -42,9 +42,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -67,6 +67,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__split-workflow.yml
generated
vendored
5
.github/workflows/__split-workflow.yml
generated
vendored
@@ -30,9 +30,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
3
.github/workflows/__submit-sarif-failure.yml
generated
vendored
3
.github/workflows/__submit-sarif-failure.yml
generated
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: Submit SARIF after failure
|
||||
@@ -45,6 +45,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
5
.github/workflows/__swift-custom-build.yml
generated
vendored
5
.github/workflows/__swift-custom-build.yml
generated
vendored
@@ -30,9 +30,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
@@ -51,6 +51,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
1
.github/workflows/__test-autobuild-working-dir.yml
generated
vendored
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__test-local-codeql.yml
generated
vendored
1
.github/workflows/__test-local-codeql.yml
generated
vendored
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
1
.github/workflows/__test-proxy.yml
generated
vendored
1
.github/workflows/__test-proxy.yml
generated
vendored
@@ -41,6 +41,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
3
.github/workflows/__unset-environment.yml
generated
vendored
3
.github/workflows/__unset-environment.yml
generated
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
- os: ubuntu-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
@@ -53,6 +53,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
7
.github/workflows/__upload-ref-sha-input.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
7
.github/workflows/__with-checkout-path.yml
generated
vendored
7
.github/workflows/__with-checkout-path.yml
generated
vendored
@@ -50,11 +50,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
version: stable-20230418
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: windows-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
- os: macos-latest
|
||||
@@ -81,6 +81,7 @@ jobs:
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: 'false'
|
||||
- name: Set environment variable for Swift enablement
|
||||
if: >-
|
||||
runner.os != 'Windows' && (
|
||||
|
||||
@@ -30,9 +30,9 @@ jobs:
|
||||
- os: macos-latest
|
||||
version: latest
|
||||
- os: ubuntu-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: macos-latest
|
||||
version: cached
|
||||
version: default
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
- os: macos-latest
|
||||
|
||||
4
.github/workflows/debug-artifacts.yml
vendored
4
.github/workflows/debug-artifacts.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
- stable-20220908
|
||||
- stable-20221211
|
||||
- stable-20230418
|
||||
- cached
|
||||
- default
|
||||
- latest
|
||||
- nightly-latest
|
||||
name: Upload debug artifacts
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
- name: Check expected artifacts exist
|
||||
shell: bash
|
||||
run: |
|
||||
VERSIONS="stable-20220615 stable-20220908 stable-20221211 stable-20230418 cached latest nightly-latest"
|
||||
VERSIONS="stable-20220615 stable-20220908 stable-20221211 stable-20230418 default latest nightly-latest"
|
||||
LANGUAGES="cpp csharp go java javascript python"
|
||||
for version in $VERSIONS; do
|
||||
for os in ubuntu-latest macos-latest; do
|
||||
|
||||
56
.github/workflows/test-codeql-bundle-all.yml
vendored
Normal file
56
.github/workflows/test-codeql-bundle-all.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: 'PR Check - CodeQL Bundle All'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GO111MODULE: auto
|
||||
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
|
||||
# workaround for our PR checks.
|
||||
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- releases/v2
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- ready_for_review
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
test-codeql-bundle-all:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: nightly-latest
|
||||
name: 'CodeQL Bundle All'
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
timeout-minutes: 45
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Prepare test
|
||||
id: prepare-test
|
||||
uses: ./.github/actions/prepare-test
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
use-all-platform-bundle: true
|
||||
- id: init
|
||||
uses: ./../action/init
|
||||
with:
|
||||
tools: ${{ steps.prepare-test.outputs.tools-url }}
|
||||
- uses: ./../action/.github/actions/setup-swift
|
||||
with:
|
||||
codeql-path: ${{ steps.init.outputs.codeql-path }}
|
||||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
with:
|
||||
upload-database: false
|
||||
env:
|
||||
CODEQL_ACTION_TEST_MODE: true
|
||||
16
lib/codeql.js
generated
16
lib/codeql.js
generated
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getGeneratedCodeScanningConfigPath = exports.getTrapCachingExtractorConfigArgsForLang = exports.getTrapCachingExtractorConfigArgs = exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_EXPORT_CODE_SCANNING_CONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CommandInvocationError = void 0;
|
||||
exports.getGeneratedCodeScanningConfigPath = exports.getTrapCachingExtractorConfigArgsForLang = exports.getTrapCachingExtractorConfigArgs = exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED = exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_EXPORT_CODE_SCANNING_CONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CommandInvocationError = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
@@ -100,6 +100,10 @@ exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
|
||||
* determines that no code has been found.
|
||||
*/
|
||||
exports.CODEQL_VERSION_BETTER_NO_CODE_ERROR_MESSAGE = "2.12.4";
|
||||
/**
|
||||
* Versions 2.13.1+ of the CodeQL CLI fix a bug where diagnostics export could produce invalid SARIF.
|
||||
*/
|
||||
exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED = "2.13.1";
|
||||
/**
|
||||
* Versions 2.13.4+ of the CodeQL CLI support the `resolve build-environment` command.
|
||||
*/
|
||||
@@ -449,8 +453,8 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
},
|
||||
async databaseInterpretResults(databasePath, querySuitePaths, sarifFile, addSnippetsFlag, threadsFlag, verbosityFlag, automationDetailsId, config, features, logger) {
|
||||
const shouldExportDiagnostics = await features.getValue(feature_flags_1.Feature.ExportDiagnosticsEnabled, this);
|
||||
// Update this to take into account the CodeQL version when we have a version with the fix.
|
||||
const shouldWorkaroundInvalidNotifications = shouldExportDiagnostics;
|
||||
const shouldWorkaroundInvalidNotifications = shouldExportDiagnostics &&
|
||||
!(await isDiagnosticsExportInvalidSarifFixed(this));
|
||||
const codeqlOutputFile = shouldWorkaroundInvalidNotifications
|
||||
? path.join(config.tempDir, "codeql-intermediate-results.sarif")
|
||||
: sarifFile;
|
||||
@@ -576,8 +580,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
||||
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||
},
|
||||
async databaseExportDiagnostics(databasePath, sarifFile, automationDetailsId, tempDir, logger) {
|
||||
// Update this to take into account the CodeQL version when we have a version with the fix.
|
||||
const shouldWorkaroundInvalidNotifications = true;
|
||||
const shouldWorkaroundInvalidNotifications = !(await isDiagnosticsExportInvalidSarifFixed(this));
|
||||
const codeqlOutputFile = shouldWorkaroundInvalidNotifications
|
||||
? path.join(tempDir, "codeql-intermediate-results.sarif")
|
||||
: sarifFile;
|
||||
@@ -949,4 +952,7 @@ function isNoCodeFoundError(e) {
|
||||
const javascriptNoCodeFoundWarning = "No JavaScript or TypeScript code found.";
|
||||
return e.exitCode === 32 || e.error.includes(javascriptNoCodeFoundWarning);
|
||||
}
|
||||
async function isDiagnosticsExportInvalidSarifFixed(codeql) {
|
||||
return await util.codeQlVersionAbove(codeql, exports.CODEQL_VERSION_DIAGNOSTICS_EXPORT_FIXED);
|
||||
}
|
||||
//# sourceMappingURL=codeql.js.map
|
||||
File diff suppressed because one or more lines are too long
6
lib/feature-flags.js
generated
6
lib/feature-flags.js
generated
@@ -52,6 +52,7 @@ exports.CODEQL_VERSION_INTRA_LAYER_PARALLELISM = "2.14.0";
|
||||
var Feature;
|
||||
(function (Feature) {
|
||||
Feature["CliConfigFileEnabled"] = "cli_config_file_enabled";
|
||||
Feature["CodeqlJavaLombokEnabled"] = "codeql_java_lombok_enabled";
|
||||
Feature["DisableKotlinAnalysisEnabled"] = "disable_kotlin_analysis_enabled";
|
||||
Feature["DisablePythonDependencyInstallationEnabled"] = "disable_python_dependency_installation_enabled";
|
||||
Feature["EvaluatorIntraLayerParallelismEnabled"] = "evaluator_intra_layer_parallelism_enabled";
|
||||
@@ -63,6 +64,11 @@ var Feature;
|
||||
Feature["UploadFailedSarifEnabled"] = "upload_failed_sarif_enabled";
|
||||
})(Feature || (exports.Feature = Feature = {}));
|
||||
exports.featureConfig = {
|
||||
[Feature.CodeqlJavaLombokEnabled]: {
|
||||
envVar: "CODEQL_JAVA_LOMBOK",
|
||||
minimumVersion: "2.14.0",
|
||||
defaultValue: false,
|
||||
},
|
||||
[Feature.DisableKotlinAnalysisEnabled]: {
|
||||
envVar: "CODEQL_DISABLE_KOTLIN_ANALYSIS",
|
||||
minimumVersion: undefined,
|
||||
|
||||
File diff suppressed because one or more lines are too long
10
lib/init-action.js
generated
10
lib/init-action.js
generated
@@ -178,6 +178,16 @@ async function run() {
|
||||
if (await features.getValue(feature_flags_1.Feature.DisableKotlinAnalysisEnabled)) {
|
||||
core.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true");
|
||||
}
|
||||
if (config.languages.includes(languages_1.Language.java)) {
|
||||
if (await features.getValue(feature_flags_1.Feature.CodeqlJavaLombokEnabled, codeql)) {
|
||||
logger.info("Enabling CodeQL Java Lombok support");
|
||||
core.exportVariable("CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS", "true");
|
||||
}
|
||||
else {
|
||||
logger.info("Disabling CodeQL Java Lombok support");
|
||||
core.exportVariable("CODEQL_EXTRACTOR_JAVA_RUN_ANNOTATION_PROCESSORS", "false");
|
||||
}
|
||||
}
|
||||
// Disable Python dependency extraction if feature flag set
|
||||
if (await features.getValue(feature_flags_1.Feature.DisablePythonDependencyInstallationEnabled, codeql)) {
|
||||
core.exportVariable("CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true");
|
||||
|
||||
File diff suppressed because one or more lines are too long
47
lib/setup-codeql.js
generated
47
lib/setup-codeql.js
generated
@@ -421,25 +421,22 @@ async function downloadCodeQL(codeqlURL, maybeBundleVersion, maybeCliVersion, ap
|
||||
const dest = path.join(tempDir, (0, uuid_1.v4)());
|
||||
const finalHeaders = Object.assign({ "User-Agent": "CodeQL Action" }, headers);
|
||||
const toolsDownloadStart = perf_hooks_1.performance.now();
|
||||
const codeqlPath = await toolcache.downloadTool(codeqlURL, dest, authorization, finalHeaders);
|
||||
const archivedBundlePath = await toolcache.downloadTool(codeqlURL, dest, authorization, finalHeaders);
|
||||
const toolsDownloadDurationMs = Math.round(perf_hooks_1.performance.now() - toolsDownloadStart);
|
||||
logger.debug(`Finished downloading CodeQL bundle to ${codeqlPath} (${toolsDownloadDurationMs} ms).`);
|
||||
const codeqlExtracted = await toolcache.extractTar(codeqlPath);
|
||||
logger.debug(`Finished extracting CodeQL bundle to ${codeqlExtracted}.`);
|
||||
try {
|
||||
await (0, del_1.default)(codeqlPath, { force: true });
|
||||
logger.debug("Deleted CodeQL bundle archive.");
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning("Failed to delete CodeQL bundle archive.");
|
||||
}
|
||||
logger.debug(`Finished downloading CodeQL bundle to ${archivedBundlePath} (${toolsDownloadDurationMs} ms).`);
|
||||
logger.debug("Extracting CodeQL bundle.");
|
||||
const extractionStart = perf_hooks_1.performance.now();
|
||||
const extractedBundlePath = await toolcache.extractTar(archivedBundlePath);
|
||||
const extractionMs = Math.round(perf_hooks_1.performance.now() - extractionStart);
|
||||
logger.debug(`Finished extracting CodeQL bundle to ${extractedBundlePath} (${extractionMs} ms).`);
|
||||
await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger);
|
||||
const bundleVersion = maybeBundleVersion ?? tryGetBundleVersionFromUrl(codeqlURL, logger);
|
||||
if (bundleVersion === undefined) {
|
||||
logger.debug("Could not cache CodeQL tools because we could not determine the bundle version from the " +
|
||||
`URL ${codeqlURL}.`);
|
||||
return {
|
||||
toolsVersion: maybeCliVersion ?? "unknown",
|
||||
codeqlFolder: codeqlExtracted,
|
||||
codeqlFolder: extractedBundlePath,
|
||||
toolsDownloadDurationMs,
|
||||
};
|
||||
}
|
||||
@@ -461,9 +458,15 @@ async function downloadCodeQL(codeqlURL, maybeBundleVersion, maybeCliVersion, ap
|
||||
const toolcacheVersion = maybeCliVersion?.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)
|
||||
? `${maybeCliVersion}-${bundleVersion}`
|
||||
: convertToSemVer(bundleVersion, logger);
|
||||
logger.debug("Caching CodeQL bundle.");
|
||||
const toolcachedBundlePath = await toolcache.cacheDir(extractedBundlePath, "CodeQL", toolcacheVersion);
|
||||
// Defensive check: we expect `cacheDir` to copy the bundle to a new location.
|
||||
if (toolcachedBundlePath !== extractedBundlePath) {
|
||||
await cleanUpGlob(extractedBundlePath, "CodeQL bundle from temporary directory", logger);
|
||||
}
|
||||
return {
|
||||
toolsVersion: maybeCliVersion ?? toolcacheVersion,
|
||||
codeqlFolder: await toolcache.cacheDir(codeqlExtracted, "CodeQL", toolcacheVersion),
|
||||
codeqlFolder: toolcachedBundlePath,
|
||||
toolsDownloadDurationMs,
|
||||
};
|
||||
}
|
||||
@@ -519,4 +522,22 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau
|
||||
return { codeqlFolder, toolsDownloadDurationMs, toolsSource, toolsVersion };
|
||||
}
|
||||
exports.setupCodeQLBundle = setupCodeQLBundle;
|
||||
async function cleanUpGlob(glob, name, logger) {
|
||||
logger.debug(`Cleaning up ${name}.`);
|
||||
try {
|
||||
const deletedPaths = await (0, del_1.default)(glob, { force: true });
|
||||
if (deletedPaths.length === 0) {
|
||||
logger.warning(`Failed to clean up ${name}: no files found matching ${glob}.`);
|
||||
}
|
||||
else if (deletedPaths.length === 1) {
|
||||
logger.debug(`Cleaned up ${name}.`);
|
||||
}
|
||||
else {
|
||||
logger.debug(`Cleaned up ${name} (${deletedPaths.length} files).`);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
logger.warning(`Failed to clean up ${name}: ${e}.`);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=setup-codeql.js.map
|
||||
File diff suppressed because one or more lines are too long
6
lib/util.js
generated
6
lib/util.js
generated
@@ -109,9 +109,9 @@ function getSystemReservedMemoryMegaBytes(totalMemoryMegaBytes, platform, isScal
|
||||
// Windows needs more memory for OS processes.
|
||||
const fixedAmount = 1024 * (platform === "win32" ? 1.5 : 1);
|
||||
if (isScalingReservedRamEnabled) {
|
||||
// Reserve an additional 2.5% of the amount of memory above 8 GB, since the amount used by
|
||||
// the kernel for page tables scales with the size of physical memory.
|
||||
const scaledAmount = 0.025 * Math.max(totalMemoryMegaBytes - 8 * 1024, 0);
|
||||
// Reserve an additional 5% of the amount of memory above 8 GB, since the amount used by the
|
||||
// kernel for page tables scales with the size of physical memory.
|
||||
const scaledAmount = 0.05 * Math.max(totalMemoryMegaBytes - 8 * 1024, 0);
|
||||
return fixedAmount + scaledAmount;
|
||||
}
|
||||
else {
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
lib/util.test.js
generated
4
lib/util.test.js
generated
@@ -73,14 +73,14 @@ const GET_MEMORY_FLAG_TESTS = [
|
||||
totalMemoryMb: 64 * 1024,
|
||||
platform: "linux",
|
||||
expectedMemoryValue: 63 * 1024,
|
||||
expectedMemoryValueWithScaling: 63078, // Math.floor(1024 * (64 - 1 - 0.025 * (64 - 8)))
|
||||
expectedMemoryValueWithScaling: 61644, // Math.floor(1024 * (64 - 1 - 0.05 * (64 - 8)))
|
||||
},
|
||||
{
|
||||
input: undefined,
|
||||
totalMemoryMb: 64 * 1024,
|
||||
platform: "win32",
|
||||
expectedMemoryValue: 62.5 * 1024,
|
||||
expectedMemoryValueWithScaling: 62566, // Math.floor(1024 * (64 - 1.5 - 0.025 * (64 - 8)))
|
||||
expectedMemoryValueWithScaling: 61132, // Math.floor(1024 * (64 - 1.5 - 0.05 * (64 - 8)))
|
||||
},
|
||||
];
|
||||
for (const { input, totalMemoryMb, platform, expectedMemoryValue, expectedMemoryValueWithScaling, } of GET_MEMORY_FLAG_TESTS) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
90
node_modules/.package-lock.json
generated
vendored
90
node_modules/.package-lock.json
generated
vendored
@@ -906,9 +906,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/sinon": {
|
||||
"version": "10.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.15.tgz",
|
||||
"integrity": "sha512-3lrFNQG0Kr2LDzvjyjB6AMJk4ge+8iYhQfdnSwIwlG88FUOV43kPcQqDZkDa/h3WSZy6i8Fr0BSjfQtB1B3xuQ==",
|
||||
"version": "10.0.16",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.16.tgz",
|
||||
"integrity": "sha512-j2Du5SYpXZjJVJtXBokASpPRj+e2z+VUhCPHmM6WMfe3dpHu6iVKJMU6AiBcMp/XTAYnEj6Wc1trJUWwZ0QaAQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/sinonjs__fake-timers": "*"
|
||||
@@ -934,16 +934,16 @@
|
||||
"integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.2.0.tgz",
|
||||
"integrity": "sha512-rClGrMuyS/3j0ETa1Ui7s6GkLhfZGKZL3ZrChLeAiACBE/tRc1wq8SNZESUuluxhLj9FkUefRs2l6bCIArWBiQ==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.2.1.tgz",
|
||||
"integrity": "sha512-iZVM/ALid9kO0+I81pnp1xmYiFyqibAHzrqX4q5YvvVEyJqY+e6rfTXSCsc2jUxGNqJqTfFSSij/NFkZBiBzLw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.2.0",
|
||||
"@typescript-eslint/type-utils": "6.2.0",
|
||||
"@typescript-eslint/utils": "6.2.0",
|
||||
"@typescript-eslint/visitor-keys": "6.2.0",
|
||||
"@typescript-eslint/scope-manager": "6.2.1",
|
||||
"@typescript-eslint/type-utils": "6.2.1",
|
||||
"@typescript-eslint/utils": "6.2.1",
|
||||
"@typescript-eslint/visitor-keys": "6.2.1",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
@@ -970,15 +970,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.0.tgz",
|
||||
"integrity": "sha512-igVYOqtiK/UsvKAmmloQAruAdUHihsOCvplJpplPZ+3h4aDkC/UKZZNKgB6h93ayuYLuEymU3h8nF1xMRbh37g==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.2.1.tgz",
|
||||
"integrity": "sha512-Ld+uL1kYFU8e6btqBFpsHkwQ35rw30IWpdQxgOqOh4NfxSDH6uCkah1ks8R/RgQqI5hHPXMaLy9fbFseIe+dIg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.2.0",
|
||||
"@typescript-eslint/types": "6.2.0",
|
||||
"@typescript-eslint/typescript-estree": "6.2.0",
|
||||
"@typescript-eslint/visitor-keys": "6.2.0",
|
||||
"@typescript-eslint/scope-manager": "6.2.1",
|
||||
"@typescript-eslint/types": "6.2.1",
|
||||
"@typescript-eslint/typescript-estree": "6.2.1",
|
||||
"@typescript-eslint/visitor-keys": "6.2.1",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -998,13 +998,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.0.tgz",
|
||||
"integrity": "sha512-1ZMNVgm5nnHURU8ZSJ3snsHzpFeNK84rdZjluEVBGNu7jDymfqceB3kdIZ6A4xCfEFFhRIB6rF8q/JIqJd2R0Q==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.2.1.tgz",
|
||||
"integrity": "sha512-UCqBF9WFqv64xNsIEPfBtenbfodPXsJ3nPAr55mGPkQIkiQvgoWNo+astj9ZUfJfVKiYgAZDMnM6dIpsxUMp3Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.2.0",
|
||||
"@typescript-eslint/visitor-keys": "6.2.0"
|
||||
"@typescript-eslint/types": "6.2.1",
|
||||
"@typescript-eslint/visitor-keys": "6.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1015,13 +1015,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.2.0.tgz",
|
||||
"integrity": "sha512-DnGZuNU2JN3AYwddYIqrVkYW0uUQdv0AY+kz2M25euVNlujcN2u+rJgfJsBFlUEzBB6OQkUqSZPyuTLf2bP5mw==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.2.1.tgz",
|
||||
"integrity": "sha512-fTfCgomBMIgu2Dh2Or3gMYgoNAnQm3RLtRp+jP7A8fY+LJ2+9PNpi5p6QB5C4RSP+U3cjI0vDlI3mspAkpPVbQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.2.0",
|
||||
"@typescript-eslint/utils": "6.2.0",
|
||||
"@typescript-eslint/typescript-estree": "6.2.1",
|
||||
"@typescript-eslint/utils": "6.2.1",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
@@ -1042,9 +1042,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.0.tgz",
|
||||
"integrity": "sha512-1nRRaDlp/XYJQLvkQJG5F3uBTno5SHPT7XVcJ5n1/k2WfNI28nJsvLakxwZRNY5spuatEKO7d5nZWsQpkqXwBA==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.2.1.tgz",
|
||||
"integrity": "sha512-528bGcoelrpw+sETlyM91k51Arl2ajbNT9L4JwoXE2dvRe1yd8Q64E4OL7vHYw31mlnVsf+BeeLyAZUEQtqahQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
@@ -1055,13 +1055,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.0.tgz",
|
||||
"integrity": "sha512-Mts6+3HQMSM+LZCglsc2yMIny37IhUgp1Qe8yJUYVyO6rHP7/vN0vajKu3JvHCBIy8TSiKddJ/Zwu80jhnGj1w==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.2.1.tgz",
|
||||
"integrity": "sha512-G+UJeQx9AKBHRQBpmvr8T/3K5bJa485eu+4tQBxFq0KoT22+jJyzo1B50JDT9QdC1DEmWQfdKsa8ybiNWYsi0Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.2.0",
|
||||
"@typescript-eslint/visitor-keys": "6.2.0",
|
||||
"@typescript-eslint/types": "6.2.1",
|
||||
"@typescript-eslint/visitor-keys": "6.2.1",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
@@ -1082,17 +1082,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.2.0.tgz",
|
||||
"integrity": "sha512-RCFrC1lXiX1qEZN8LmLrxYRhOkElEsPKTVSNout8DMzf8PeWoQG7Rxz2SadpJa3VSh5oYKGwt7j7X/VRg+Y3OQ==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.2.1.tgz",
|
||||
"integrity": "sha512-eBIXQeupYmxVB6S7x+B9SdBeB6qIdXKjgQBge2J+Ouv8h9Cxm5dHf/gfAZA6dkMaag+03HdbVInuXMmqFB/lKQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.2.0",
|
||||
"@typescript-eslint/types": "6.2.0",
|
||||
"@typescript-eslint/typescript-estree": "6.2.0",
|
||||
"@typescript-eslint/scope-manager": "6.2.1",
|
||||
"@typescript-eslint/types": "6.2.1",
|
||||
"@typescript-eslint/typescript-estree": "6.2.1",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1107,12 +1107,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.0.tgz",
|
||||
"integrity": "sha512-QbaYUQVKKo9bgCzpjz45llCfwakyoxHetIy8CAvYCtd16Zu1KrpzNHofwF8kGkpPOxZB2o6kz+0nqH8ZkIzuoQ==",
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.2.1.tgz",
|
||||
"integrity": "sha512-iTN6w3k2JEZ7cyVdZJTVJx2Lv7t6zFA8DCrJEHD2mwfc16AEvvBWVhbFh34XyG2NORCd0viIgQY1+u7kPI0WpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.2.0",
|
||||
"@typescript-eslint/types": "6.2.1",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
2
node_modules/@types/sinon/README.md
generated
vendored
2
node_modules/@types/sinon/README.md
generated
vendored
@@ -8,7 +8,7 @@ This package contains type definitions for Sinon (https://sinonjs.org).
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Sun, 14 May 2023 04:32:51 GMT
|
||||
* Last updated: Tue, 01 Aug 2023 09:02:50 GMT
|
||||
* Dependencies: [@types/sinonjs__fake-timers](https://npmjs.com/package/@types/sinonjs__fake-timers)
|
||||
* Global values: `sinon`
|
||||
|
||||
|
||||
2
node_modules/@types/sinon/index.d.ts
generated
vendored
2
node_modules/@types/sinon/index.d.ts
generated
vendored
@@ -775,7 +775,7 @@ declare namespace Sinon {
|
||||
}
|
||||
|
||||
interface SinonMockStatic {
|
||||
(): SinonExpectation;
|
||||
(name?: string): SinonExpectation;
|
||||
/**
|
||||
* Creates a mock for the provided object.
|
||||
* Does not change the object, but returns a mock object to set expectations on the object’s methods.
|
||||
|
||||
4
node_modules/@types/sinon/package.json
generated
vendored
4
node_modules/@types/sinon/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/sinon",
|
||||
"version": "10.0.15",
|
||||
"version": "10.0.16",
|
||||
"description": "TypeScript definitions for Sinon",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon",
|
||||
"license": "MIT",
|
||||
@@ -57,6 +57,6 @@
|
||||
"dependencies": {
|
||||
"@types/sinonjs__fake-timers": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "c87e5ef382887bbdb8c25d070fd87c515977fd4e28b3d8cf4293c673f5e33f2e",
|
||||
"typesPublisherContentHash": "80a97a78fae8ba4177fdc4c2d9cb72ff3c90b9c29fbc7c54a1ecaa647e7128ed",
|
||||
"typeScriptVersion": "4.3"
|
||||
}
|
||||
32
node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js
generated
vendored
32
node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js
generated
vendored
@@ -231,27 +231,21 @@ exports.default = util.createRule({
|
||||
data: { typeImports },
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
messageId: 'aImportIsOnlyTypes',
|
||||
data: { typeImports },
|
||||
};
|
||||
}
|
||||
return {
|
||||
messageId: 'aImportIsOnlyTypes',
|
||||
data: { typeImports },
|
||||
};
|
||||
}
|
||||
else {
|
||||
if (isTypeImport) {
|
||||
return {
|
||||
messageId: 'someImportsInDecoMeta',
|
||||
data: { typeImports }, // typeImports are all the value specifiers that are in the type position
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
messageId: 'someImportsAreOnlyTypes',
|
||||
data: { typeImports }, // typeImports are all the type specifiers in the value position
|
||||
};
|
||||
}
|
||||
if (isTypeImport) {
|
||||
return {
|
||||
messageId: 'someImportsInDecoMeta',
|
||||
data: { typeImports }, // typeImports are all the value specifiers that are in the type position
|
||||
};
|
||||
}
|
||||
return {
|
||||
messageId: 'someImportsAreOnlyTypes',
|
||||
data: { typeImports }, // typeImports are all the type specifiers in the value position
|
||||
};
|
||||
})();
|
||||
context.report({
|
||||
node: report.node,
|
||||
|
||||
File diff suppressed because one or more lines are too long
28
node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js
generated
vendored
28
node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js
generated
vendored
@@ -162,21 +162,19 @@ exports.default = util.createRule({
|
||||
...base,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
type,
|
||||
accessibility: undefined,
|
||||
declare: false,
|
||||
decorators: [],
|
||||
definite: false,
|
||||
optional: false,
|
||||
override: false,
|
||||
readonly: false,
|
||||
static: false,
|
||||
typeAnnotation: undefined,
|
||||
...base,
|
||||
};
|
||||
}
|
||||
return {
|
||||
type,
|
||||
accessibility: undefined,
|
||||
declare: false,
|
||||
decorators: [],
|
||||
definite: false,
|
||||
optional: false,
|
||||
override: false,
|
||||
readonly: false,
|
||||
static: false,
|
||||
typeAnnotation: undefined,
|
||||
...base,
|
||||
};
|
||||
}
|
||||
return Object.assign({}, rules, {
|
||||
// overwrite the base rule here so we can use our KNOWN_NODES list instead
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map
generated
vendored
File diff suppressed because one or more lines are too long
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/key-spacing.js
generated
vendored
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/key-spacing.js
generated
vendored
@@ -116,9 +116,7 @@ exports.default = util.createRule({
|
||||
typeAnnotation.range[0],
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return fixer.insertTextBefore(typeAnnotation, ' '.repeat(-difference));
|
||||
}
|
||||
return fixer.insertTextBefore(typeAnnotation, ' '.repeat(-difference));
|
||||
},
|
||||
data: {
|
||||
computed: '',
|
||||
@@ -143,9 +141,7 @@ exports.default = util.createRule({
|
||||
typeAnnotation.typeAnnotation.range[0],
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return fixer.insertTextBefore(typeAnnotation.typeAnnotation, ' '.repeat(-difference));
|
||||
}
|
||||
return fixer.insertTextBefore(typeAnnotation.typeAnnotation, ' '.repeat(-difference));
|
||||
},
|
||||
data: {
|
||||
computed: '',
|
||||
@@ -250,9 +246,7 @@ exports.default = util.createRule({
|
||||
toCheck.range[0],
|
||||
]);
|
||||
}
|
||||
else {
|
||||
return fixer.insertTextBefore(toCheck, ' '.repeat(-difference));
|
||||
}
|
||||
return fixer.insertTextBefore(toCheck, ' '.repeat(-difference));
|
||||
},
|
||||
data: {
|
||||
computed: '',
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/key-spacing.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/key-spacing.js.map
generated
vendored
File diff suppressed because one or more lines are too long
44
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
44
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
@@ -101,12 +101,10 @@ exports.default = util.createRule({
|
||||
if (isHigherPrecedenceThanUnary(tsNode)) {
|
||||
return fixer.insertTextBefore(node, 'void ');
|
||||
}
|
||||
else {
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'void ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
}
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'void ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -130,12 +128,10 @@ exports.default = util.createRule({
|
||||
if (isHigherPrecedenceThanUnary(tsNode)) {
|
||||
return fixer.insertTextBefore(node, 'await ');
|
||||
}
|
||||
else {
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
}
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -195,18 +191,14 @@ exports.default = util.createRule({
|
||||
if (isValidRejectionHandler(catchRejectionHandler)) {
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
else {
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
const thenRejectionHandler = getRejectionHandlerFromThenCall(node);
|
||||
if (thenRejectionHandler) {
|
||||
if (isValidRejectionHandler(thenRejectionHandler)) {
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
else {
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
// `x.finally()` is transparent to resolution of the promise, so check `x`.
|
||||
// ("object" in this context is the `x` in `x.finally()`)
|
||||
@@ -224,9 +216,7 @@ exports.default = util.createRule({
|
||||
if (alternateResult.isUnhandled) {
|
||||
return alternateResult;
|
||||
}
|
||||
else {
|
||||
return isUnhandledPromise(checker, node.consequent);
|
||||
}
|
||||
return isUnhandledPromise(checker, node.consequent);
|
||||
}
|
||||
else if (node.type === utils_1.AST_NODE_TYPES.MemberExpression ||
|
||||
node.type === utils_1.AST_NODE_TYPES.Identifier ||
|
||||
@@ -241,9 +231,7 @@ exports.default = util.createRule({
|
||||
if (leftResult.isUnhandled) {
|
||||
return leftResult;
|
||||
}
|
||||
else {
|
||||
return isUnhandledPromise(checker, node.right);
|
||||
}
|
||||
return isUnhandledPromise(checker, node.right);
|
||||
}
|
||||
// We conservatively return false for all other types of expressions because
|
||||
// we don't want to accidentally fail if the promise is handled internally but
|
||||
@@ -296,9 +284,7 @@ function getRejectionHandlerFromCatchCall(expression) {
|
||||
expression.arguments.length >= 1) {
|
||||
return expression.arguments[0];
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getRejectionHandlerFromThenCall(expression) {
|
||||
if (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
@@ -307,9 +293,7 @@ function getRejectionHandlerFromThenCall(expression) {
|
||||
expression.arguments.length >= 2) {
|
||||
return expression.arguments[1];
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function getObjectFromFinallyCall(expression) {
|
||||
return expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
File diff suppressed because one or more lines are too long
13
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js
generated
vendored
13
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js
generated
vendored
@@ -179,10 +179,15 @@ exports.default = util.createRule({
|
||||
if (ignoreParameters || !node.params) {
|
||||
return;
|
||||
}
|
||||
node.params.filter(param => param.type === utils_1.AST_NODE_TYPES.AssignmentPattern &&
|
||||
param.left &&
|
||||
param.right).forEach(param => {
|
||||
reportInferrableType(param, param.left.typeAnnotation, param.right);
|
||||
node.params.forEach(param => {
|
||||
if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) {
|
||||
param = param.parameter;
|
||||
}
|
||||
if (param.type === utils_1.AST_NODE_TYPES.AssignmentPattern &&
|
||||
param.left &&
|
||||
param.right) {
|
||||
reportInferrableType(param, param.left.typeAnnotation, param.right);
|
||||
}
|
||||
});
|
||||
}
|
||||
function inferrablePropertyVisitor(node) {
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js
generated
vendored
8
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js
generated
vendored
@@ -401,11 +401,9 @@ exports.default = util.createRule({
|
||||
column: identifier.loc.start.column + 1,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
global: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
global: true,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Checks the current context for shadowed variables.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -66,9 +66,7 @@ exports.default = util.createRule({
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return ((type.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) !== 0);
|
||||
}
|
||||
return (type.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) !== 0;
|
||||
};
|
||||
const sameTypeWithoutNullish = (assertedTypes, originalTypes) => {
|
||||
const nonNullishOriginalTypes = originalTypes.filter(type => (type.flags & (ts.TypeFlags.Null | ts.TypeFlags.Undefined)) === 0);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"non-nullable-type-assertion-style.js","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K,sBAAc,CAAC,eAAe;gBAC3D,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU;gBAC/D,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,OAAO,CAC9C,CAAC;QACJ,CAAC,CAAC;QAEF,OAAO;YACL,iCAAiC,CAC/B,IAAwD;gBAExD,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;oBAC1B,OAAO;iBACR;gBAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC1D,IAAI,CAAC,aAAa,EAAE;oBAClB,OAAO;iBACR;gBAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC9D,IAAI,CAAC,aAAa,EAAE;oBAClB,OAAO;iBACR;gBAED,IAAI,sBAAsB,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE;oBACxD,OAAO,CAAC,MAAM,CAAC;wBACb,GAAG,CAAC,KAAK;4BACP,OAAO,KAAK,CAAC,WAAW,CACtB,IAAI,EACJ,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAC1C,CAAC;wBACJ,CAAC;wBACD,SAAS,EAAE,wBAAwB;wBACnC,IAAI;qBACL,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
{"version":3,"file":"non-nullable-type-assertion-style.js","sourceRoot":"","sources":["../../src/rules/non-nullable-type-assertion-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,sDAAwC;AACxC,+CAAiC;AAEjC,8CAAgC;AAEhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,mCAAmC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,sDAAsD;YACnE,WAAW,EA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aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC1D,IAAI,CAAC,aAAa,EAAE;oBAClB,OAAO;iBACR;gBAED,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBAC9D,IAAI,CAAC,aAAa,EAAE;oBAClB,OAAO;iBACR;gBAED,IAAI,sBAAsB,CAAC,aAAa,EAAE,aAAa,CAAC,EAAE;oBACxD,OAAO,CAAC,MAAM,CAAC;wBACb,GAAG,CAAC,KAAK;4BACP,OAAO,KAAK,CAAC,WAAW,CACtB,IAAI,EACJ,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAC1C,CAAC;wBACJ,CAAC;wBACD,SAAS,EAAE,wBAAwB;wBACnC,IAAI;qBACL,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
@@ -251,15 +251,13 @@ function getFixer(sourceCode, parserServices, operator, options, chain) {
|
||||
right: unaryOperator + newCode,
|
||||
};
|
||||
}
|
||||
else {
|
||||
const unaryOperator = lastOperand.node.left.type === utils_1.AST_NODE_TYPES.UnaryExpression
|
||||
? lastOperand.node.left.operator + ' '
|
||||
: '';
|
||||
return {
|
||||
left: unaryOperator + newCode,
|
||||
right: sourceCode.getText(lastOperand.node.right),
|
||||
};
|
||||
}
|
||||
const unaryOperator = lastOperand.node.left.type === utils_1.AST_NODE_TYPES.UnaryExpression
|
||||
? lastOperand.node.left.operator + ' '
|
||||
: '';
|
||||
return {
|
||||
left: unaryOperator + newCode,
|
||||
right: sourceCode.getText(lastOperand.node.right),
|
||||
};
|
||||
})();
|
||||
newCode = `${left} ${operator} ${right}`;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -94,13 +94,11 @@ function gatherLogicalOperands(node, parserServices, options) {
|
||||
isYoda: false,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
comparedExpression: operand.right,
|
||||
comparedValue: getComparisonValueType(operand.left),
|
||||
isYoda: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
comparedExpression: operand.right,
|
||||
comparedValue: getComparisonValueType(operand.left),
|
||||
isYoda: true,
|
||||
};
|
||||
})();
|
||||
if (comparedValue === "UndefinedStringLiteral" /* ComparisonValueType.UndefinedStringLiteral */) {
|
||||
if (comparedExpression.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -161,11 +161,13 @@ exports.default = (0, util_1.createRule)({
|
||||
/**
|
||||
* Parse a given `RegExp` pattern to that string if it's a static string.
|
||||
* @param pattern The RegExp pattern text to parse.
|
||||
* @param uFlag The Unicode flag of the RegExp.
|
||||
* @param unicode Whether the RegExp is unicode.
|
||||
*/
|
||||
function parseRegExpText(pattern, uFlag) {
|
||||
function parseRegExpText(pattern, unicode) {
|
||||
// Parse it.
|
||||
const ast = regexpp.parsePattern(pattern, undefined, undefined, uFlag);
|
||||
const ast = regexpp.parsePattern(pattern, undefined, undefined, {
|
||||
unicode,
|
||||
});
|
||||
if (ast.alternatives.length !== 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
10
node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js
generated
vendored
10
node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js
generated
vendored
@@ -134,12 +134,10 @@ exports.default = util.createRule({
|
||||
if (isHighPrecendence) {
|
||||
return fixer.insertTextBefore(node, 'await ');
|
||||
}
|
||||
else {
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfter(node, ')'),
|
||||
];
|
||||
}
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfter(node, ')'),
|
||||
];
|
||||
}
|
||||
function isHigherPrecedenceThanAwait(node) {
|
||||
const operator = ts.isBinaryExpression(node)
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map
generated
vendored
File diff suppressed because one or more lines are too long
8
node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js
generated
vendored
8
node_modules/@typescript-eslint/eslint-plugin/dist/rules/type-annotation-spacing.js
generated
vendored
@@ -58,9 +58,7 @@ function getIdentifierRules(rules, node) {
|
||||
else if ((0, util_1.isFunctionOrFunctionType)(scope)) {
|
||||
return rules.parameter;
|
||||
}
|
||||
else {
|
||||
return rules.colon;
|
||||
}
|
||||
return rules.colon;
|
||||
}
|
||||
function getRules(rules, node) {
|
||||
const scope = node?.parent?.parent;
|
||||
@@ -76,9 +74,7 @@ function getRules(rules, node) {
|
||||
else if ((0, util_1.isFunction)(scope)) {
|
||||
return rules.returnType;
|
||||
}
|
||||
else {
|
||||
return rules.colon;
|
||||
}
|
||||
return rules.colon;
|
||||
}
|
||||
exports.default = util.createRule({
|
||||
name: 'type-annotation-spacing',
|
||||
|
||||
File diff suppressed because one or more lines are too long
10
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js
generated
vendored
10
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js
generated
vendored
@@ -129,12 +129,10 @@ function getNameFromMember(member, sourceCode) {
|
||||
name: `"${name}"`,
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
type: MemberNameType.Normal,
|
||||
name,
|
||||
};
|
||||
}
|
||||
return {
|
||||
type: MemberNameType.Normal,
|
||||
name,
|
||||
};
|
||||
}
|
||||
return {
|
||||
type: MemberNameType.Expression,
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map
generated
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/util/misc.ts"],"names":[],"mappings":";AAAA;;G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C,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC;AA4CC,wCAAc;AA1ChB;;;;;GAKG;AACH,SAAS,aAAa,CACpB,OAAY,EACZ,SAAoD;IAEpD,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAE7B,OAAO,GAAG,IAAI,CAAC,EAAE;QACf,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,IAAI,KAAK,EAAE;YACT,OAAO,GAAG,CAAC;SACZ;QACD,GAAG,EAAE,CAAC;KACP;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AA8BC,sCAAa;AA5Bf,SAAS,2BAA2B,CAClC,IAAuB,EACvB,IAAY;IAEZ,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,cAAc;QAC3C,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,iBAAiB;QAC9C,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,iBAAiB;QAC9C,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAClE,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC;AAeC,kEAA2B"}
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Disallow or enforce spaces inside of blocks after opening block an
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/block-spacing** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/block-spacing`](https://eslint.org/docs/rules/block-spacing) rule.
|
||||
This version adds support for TypeScript related blocks (interfaces, object type literals and enums).
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Enforce consistent brace style for blocks.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/brace-style** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule.
|
||||
It adds support for `enum`, `interface`, `namespace` and `module` declarations.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-methods-use-this.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-methods-use-this.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Enforce that class methods utilize `this`.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/class-methods-use-this** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/class-methods-use-this`](https://eslint.org/docs/rules/class-methods-use-this) rule.
|
||||
It adds support for ignoring `override` methods or methods on classes that implement an interface.
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Require or disallow trailing commas.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/comma-dangle** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/comma-dangle`](https://eslint.org/docs/rules/comma-dangle) rule.
|
||||
It adds support for TypeScript syntax.
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Enforce consistent spacing before and after commas.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/comma-spacing** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/comma-spacing`](https://eslint.org/docs/rules/comma-spacing) rule.
|
||||
It adds support for trailing comma in a types parameters list.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Enforce default parameters to be last.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/default-param-last** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/default-param-last`](https://eslint.org/docs/rules/default-param-last) rule.
|
||||
It adds support for optional parameters.
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Enforce dot notation whenever possible.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/dot-notation** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation) rule.
|
||||
It adds:
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Require or disallow spacing between function identifiers and their
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule.
|
||||
It adds support for generic type parameters on function calls.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md
generated
vendored
@@ -14,7 +14,5 @@ Please read [Issue #1824: Problems with the indent rule](https://github.com/type
|
||||
|
||||
:::
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule.
|
||||
It adds support for TypeScript nodes.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Require or disallow initialization in variable declarations.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/init-declarations** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
|
||||
It adds support for TypeScript's `declare` variables.
|
||||
|
||||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Enforce consistent spacing between property names and type annotat
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/key-spacing** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/key-spacing`](https://eslint.org/docs/rules/key-spacing) rule.
|
||||
This version adds support for type annotations on interfaces, classes and type literals properties.
|
||||
It adds support for type annotations on interfaces, classes and type literals properties.
|
||||
|
||||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Enforce consistent spacing before and after keywords.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule.
|
||||
This version adds support for generic type parameters on function calls.
|
||||
It adds support for generic type parameters on function calls.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Require empty lines around comments.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/lines-around-comment** for documentation.
|
||||
|
||||
## Rule Details
|
||||
|
||||
This rule extends the base [`eslint/lines-around-comment`](https://eslint.org/docs/rules/lines-around-comment) rule.
|
||||
It adds support for TypeScript syntax.
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@ description: 'Require or disallow an empty line between class members.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/lines-between-class-members** for documentation.
|
||||
|
||||
This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule will require or disallow an empty line between class members.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/lines-between-class-members`](https://eslint.org/docs/rules/lines-between-class-members) rule.
|
||||
It adds support for ignoring overload methods in a class.
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Disallow generic `Array` constructors.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/no-array-constructor** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) rule.
|
||||
It adds support for the generically typed `Array` constructor (`new Array<Foo>()`).
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Disallow duplicate class members.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/no-dupe-class-members** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/no-dupe-class-members`](https://eslint.org/docs/rules/no-dupe-class-members) rule.
|
||||
It adds support for TypeScript's method overload definitions.
|
||||
|
||||
@@ -10,8 +10,6 @@ TypeScript supports types ("constituents") within union and intersection types b
|
||||
However, developers typically expect each constituent to be unique within its intersection or union.
|
||||
Duplicate values make the code overly verbose and generally reduce readability.
|
||||
|
||||
## Rule Details
|
||||
|
||||
This rule disallows duplicate union or intersection constituents.
|
||||
We consider types to be duplicate if they evaluate to the same result in the type system.
|
||||
For example, given `type A = string` and `type T = string | A`, this rule would flag that `A` is the same type as `string`.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md
generated
vendored
@@ -6,8 +6,6 @@ description: 'Disallow empty functions.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/no-empty-function** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/no-empty-function`](https://eslint.org/docs/rules/no-empty-function) rule.
|
||||
It adds support for handling TypeScript specific code that would otherwise trigger the rule.
|
||||
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Disallow unnecessary parentheses.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/no-extra-parens** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule.
|
||||
It adds support for TypeScript type assertions.
|
||||
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md
generated
vendored
@@ -6,7 +6,5 @@ description: 'Disallow unnecessary semicolons.'
|
||||
>
|
||||
> See **https://typescript-eslint.io/rules/no-extra-semi** for documentation.
|
||||
|
||||
## Examples
|
||||
|
||||
This rule extends the base [`eslint/no-extra-semi`](https://eslint.org/docs/rules/no-extra-semi) rule.
|
||||
It adds support for class properties.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user