Skip to content

Commit

Permalink
⚡ Update qodana to 2022.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Feb 15, 2023
1 parent 6ef9e1a commit e04c1d0
Show file tree
Hide file tree
Showing 13 changed files with 400 additions and 351 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
with:
fetch-depth: 0
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2022.3.3
uses: JetBrains/qodana-action@v2022.3.4
```
Using this workflow, Qodana will run on the main branch, release branches, and on the pull requests coming to your
Expand All @@ -71,7 +71,7 @@ To send the results to Qodana Cloud, all you need to do is to specify the `QODAN

```yaml
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2022.3.3
uses: JetBrains/qodana-action@v2022.3.4
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
```
Expand Down Expand Up @@ -151,7 +151,7 @@ qodana scan --show-report

```yaml
- name: Qodana Scan
uses: JetBrains/qodana-action@v2022.3.3
uses: JetBrains/qodana-action@v2022.3.4
with:
args: --baseline,qodana.sarif.json
```
Expand Down
11 changes: 11 additions & 0 deletions common/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "2022.3.4",
"checksum": {
"windows_x86_64": "3aaed3552cde7d48fd7b81578e24a7b033be8748e9fb86afca5d7b420a52e9ca",
"linux_arm64": "4c03be23cfc0eaa052c1c10c626e1f9ffb9be8936c9ba73b66b91cfc8bcfe43c",
"darwin_arm64": "7313271d198b035143e9f8001d87741dc72123bf40c1dd6f8f35181268529172",
"darwin_x86_64": "808db0a6deef9c42033798b436d25c21a6fdb192eb4b73729d99e42c6fd8371c",
"windows_arm64": "ad010f503663dd996feb3048ae85466169b34998a162233f918cf41113f7ccff",
"linux_x86_64": "d22703ef05fbd6e9b286b99750cf6d90a608ad28d0b4dc3078e3c8ded4bf15d1"
}
}
18 changes: 9 additions & 9 deletions common/qodana.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import {checksum, version} from './cli.json'
import {createHash} from 'crypto'
import {readFileSync} from 'fs'

Expand All @@ -9,22 +9,22 @@ export const FAIL_THRESHOLD_OUTPUT =
'The number of problems exceeds the failThreshold'
export const QODANA_SARIF_NAME = 'qodana.sarif.json'
export const QODANA_SHORT_SARIF_NAME = 'qodana-short.sarif.json'
export const VERSION = '2022.3.3'
export const EXECUTABLE = 'qodana'
export const VERSION = version
export function getQodanaSha256(arch: string, platform: string): string {
switch (`${platform}_${arch}`) {
case 'windows_x86_64':
return 'bfa0e823962263f8d51036f94152002efd25f6499c3394d26e962e94fe115780'
return checksum['windows_x86_64']
case 'windows_arm64':
return 'aded1dd1765ec9aff5033d9cbd49445dbd4fec13c684d2d015523bbf10f41529'
return checksum['windows_arm64']
case 'linux_x86_64':
return '166b1f364b80c660ecd644f5c3009fb677bbeae33f58bc5e9e28a3dc6988eb6c'
return checksum['linux_x86_64']
case 'linux_arm64':
return '81422f12bccb67dfaa8ab6994a8a5e076d95b39a5ef95b0481d6a2e40c76fc53'
return checksum['linux_arm64']
case 'darwin_x86_64':
return 'aa6e2498803cb3c1f2def8bbe7e439e3887e1aac609ca243e0e341cd360d0c91'
return checksum['darwin_x86_64']
case 'darwin_arm64':
return '8acc312a46821cf90f94be94b22582fc1aa19a443a80952a292f1fb1c00946d1'
return checksum['darwin_arm64']
default:
throw new Error(`Qodana CLI does not exist for ${platform}_${arch}`)
}
Expand Down Expand Up @@ -55,7 +55,7 @@ export function getQodanaUrl(arch: string, platform: string): string {
throw new Error(`Unsupported architecture: ${arch}`)
}
const archive = platform === 'windows' ? 'zip' : 'tar.gz'
return `https://github.com/JetBrains/qodana-cli/releases/download/v${VERSION}/qodana_${platform}_${arch}.${archive}`
return `https://github.com/JetBrains/qodana-cli/releases/download/v${version}/qodana_${platform}_${arch}.${archive}`
}

// eslint-disable-next-line no-shadow -- shadowing is intentional here (ESLint bug)
Expand Down
6 changes: 4 additions & 2 deletions common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"composite": true
"composite": true,
"resolveJsonModule": true, /* Include modules imported with '.json' extension. */
},
"types": ".qodana.d.ts",
"exclude": ["node_modules", "**/*.test.ts"]
"exclude": ["node_modules", "**/*.test.ts"],
"files": ["cli.json", "qodana.ts"]
}
Loading

0 comments on commit e04c1d0

Please sign in to comment.