Skip to content

Commit

Permalink
Merge branch 'main' into fix-project-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
okue committed Dec 12, 2024
2 parents d2f7e29 + 383daee commit c48c66c
Show file tree
Hide file tree
Showing 29 changed files with 21,157 additions and 19,178 deletions.
31 changes: 31 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Each line represents a rule, followed by a list of members.
# These members are the default owners for all files that match the specified pattern.
# The pattern generally follows the same syntax used for .gitignore files.
# The last matching rule always wins; those that appear lower in the file take precedence over rules that appear higher up.
# Specify owners by their username, email, or role assignment in the project.

# Examples:

# Member with username "john.smith" and member with email "[email protected]"
# own any JavaScript file in repository
# *.js john.smith [email protected]

# Bob owns all files under "subdir" directory at the repository root and all its subdirectories
# /subdir/ Bob

# All members who are assigned the Project Collaborator role own any file under docs/ directory
# anywhere in the repository, but not further nested files
# docs/* "Project Collaborator"

# This file itself is owned by members who are assigned the Project Admin role in this project.

.circleci/ @tiulpin
.github/ @tiulpin
common/ @tiulpin
orb/ @tiulpin
vsts/ @tiulpin
scan/ @tiulpin
*.yml @tiulpin
*.yaml @tiulpin
gradle/ @JetBrains/qodana-developers
plugin/ @JetBrains/qodana-developers
9 changes: 3 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ updates:
schedule:
interval: weekly
groups:
npm-development:
dependency-type: development
dependencies:
patterns:
- "*"
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch

- package-ecosystem: gradle
directory: gradle
Expand Down
68 changes: 68 additions & 0 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
env:
node: true
es6: true
jest: true

globals:
Atomics: readonly
SharedArrayBuffer: readonly

ignorePatterns:
- '!.*'
- 'common/update-cli.js'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/lib/.*'
- '*.js'
- '*.d.ts'
- '*.test.ts'
- '**/coverage/.*'
- '*.json'

parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2023
sourceType: module
project:
- './tsconfig.json'

plugins:
- jest
- '@typescript-eslint'

extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended-type-checked
- plugin:jest/recommended

rules:
{
'camelcase': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'semi': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/space-before-function-paren': 'off'
}
16 changes: 10 additions & 6 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set Node.js 16.x
uses: actions/[email protected]
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: npm ci && npm run build
- name: Rebuild scan/dist/
Expand Down Expand Up @@ -89,6 +91,7 @@ jobs:
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
directory: [
Expand Down Expand Up @@ -384,11 +387,12 @@ jobs:
filters: |
azure-dev:
- "vsts/vss-extension.dev.json"
- name: Set Node.js 16.x
- name: Set Node.js
if: steps.filter.outputs.azure-dev == 'true'
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version-file: .node-version
cache: npm
- name: Install dependencies
if: steps.filter.outputs.azure-dev == 'true'
run: cd vsts && npm install && cd QodanaScan && npm install && npm i -g tfx-cli
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Node.js 16.x
uses: actions/setup-node@v4.1.0
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version-file: .node-version
cache: npm
- name: Install dependencies
run: cd vsts && npm install && cd QodanaScan && npm install && npm i -g tfx-cli
- name: Package and publish
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.6.2
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ By participating in this project, you agree to abide by our [Code of conduct](.g

Prerequisites:

- [Node.js 12.x](https://nodejs.org/)
- [Node.js](https://nodejs.org/) (the version is specified in [.node-version](.node-version))
- Java 11

Other things you might need to develop:
Expand Down
55 changes: 0 additions & 55 deletions common/.eslintrc.json

This file was deleted.

13 changes: 6 additions & 7 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@
"url": "git+https://github.com/JetBrains/qodana-cli.git"
},
"scripts": {
"lint": "eslint --fix **/*.ts"
"lint": "eslint --fix **/*.ts -c ../.github/linters/.eslintrc.yml"
},
"files": [
"qodana.ts",
"cli.json"
],
"devDependencies": {
"@types/node": "^22.5.2",
"@typescript-eslint/parser": "^7.18.0",
"@types/node": "^22.10.1",
"@typescript-eslint/parser": "^8.18.0",
"eslint": "^8.57.1",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-jest": "^28.8.2",
"eslint-plugin-jest": "^28.9.0",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "3.3.3",
"prettier": "3.4.2",
"ts-jest": "^29.2.5",
"typescript": "^5.5.4"
"typescript": "^5.7.2"
}
}
18 changes: 15 additions & 3 deletions common/qodana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export function getQodanaUrl(
return `https://github.com/JetBrains/qodana-cli/releases/download/${cli_version}/qodana_${platform}_${arch}.${archive}`
}

// eslint-disable-next-line no-shadow -- shadowing is intentional here (ESLint bug)
export enum QodanaExitCode {
Success = 0,
FailThreshold = 255
Expand Down Expand Up @@ -225,6 +224,8 @@ export interface Coverage {
freshCoverage: number
freshLines: number
freshCoveredLines: number
totalCoverageThreshold: number
freshCoverageThreshold: number
}

/**
Expand All @@ -250,7 +251,16 @@ export function getCoverageFromSarif(sarifPath: string): Coverage {
freshLines:
sarifContents.runs[0].properties['coverage']['freshLines'] || 0,
freshCoveredLines:
sarifContents.runs[0].properties['coverage']['freshCoveredLines'] || 0
sarifContents.runs[0].properties['coverage']['freshCoveredLines'] ||
0,
totalCoverageThreshold:
sarifContents.runs[0].properties['qodanaFailureConditions']?.[
'testCoverageThresholds'
]?.['totalCoverage'] || COVERAGE_THRESHOLD,
freshCoverageThreshold:
sarifContents.runs[0].properties['qodanaFailureConditions']?.[
'testCoverageThresholds'
]?.['freshCoverage'] || COVERAGE_THRESHOLD
}
} else {
return {
Expand All @@ -259,7 +269,9 @@ export function getCoverageFromSarif(sarifPath: string): Coverage {
totalCoveredLines: 0,
freshCoverage: 0,
freshLines: 0,
freshCoveredLines: 0
freshCoveredLines: 0,
totalCoverageThreshold: COVERAGE_THRESHOLD,
freshCoverageThreshold: COVERAGE_THRESHOLD
}
}
}
Expand Down
Loading

0 comments on commit c48c66c

Please sign in to comment.