Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit a9b44aa

Browse files
committed
feat!: drop qmllint 6.3.2 support
1 parent dc2f427 commit a9b44aa

File tree

4 files changed

+2
-68
lines changed

4 files changed

+2
-68
lines changed

src/configurations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function getPathFromConfig({ tool, resource }: GetPathFromConfig) {
1515
})
1616
}
1717

18+
// TODO: Split string with spaces.
1819
export function getOptionsFromConfig({ tool, resource }: GetPathFromConfig) {
1920
return (
2021
workspace

src/qmllint/server/get-version.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/qmllint/server/lint.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@ import type { CommandArgs, ExecError, StdErrError } from '../../run'
22
import { run } from '../../run'
33
import type { ErrorResult, SuccessResult } from '../../types'
44
import { notNil } from '../../utils'
5-
import type { Version } from './get-version'
6-
import { getVersion } from './get-version'
75

86
export async function lint({
97
qmlLintCommand,
108
documentPath,
119
options,
1210
}: LintArgs): Promise<LintResult> {
13-
const getVersionResult = await getVersion({ qmlLintCommand })
14-
15-
if (getVersionResult.kind !== 'Success') return getVersionResult
16-
17-
const jsonOption = getJsonOption(getVersionResult.value)
11+
const jsonOption = ['--json', '-']
1812

1913
const optionsWithJson = [
2014
...removeDuplicatedJsonOption(options),
@@ -60,15 +54,6 @@ function removeDuplicatedJsonOption(options: CommandArgs) {
6054
return cleanedOptions.filter(option => option !== '--json')
6155
}
6256

63-
function getJsonOption(version: Version) {
64-
if (compareVersion(version, '6.4.1') < 0) return ['--json']
65-
return ['--json', '-']
66-
}
67-
68-
function compareVersion(a: Version, b: Version) {
69-
return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })
70-
}
71-
7257
function parseQmlLintRunReturnValue(
7358
value: string,
7459
): ParseQmlLintRunReturnValueResult {

src/test/suite/qmllint/server/lint.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as assert from 'node:assert'
22
import * as sinon from 'sinon'
3-
import * as GetVersion from '../../../../qmllint/server/get-version'
43
import type {
54
LintArgs,
65
LintResult,
@@ -25,19 +24,8 @@ suite('qmllint/lint', () => {
2524
],
2625
}
2726

28-
const mockGetVersionResult: GetVersion.GetVersionResult = {
29-
kind: 'Success',
30-
value: '6.4.1',
31-
}
32-
3327
let result: LintResult
3428

35-
setup(() =>
36-
sinon.replace(GetVersion, 'getVersion', async () => mockGetVersionResult),
37-
)
38-
39-
teardown(() => sinon.restore())
40-
4129
suite('when linting success', () => {
4230
suite('when lint result is parsable', () => {
4331
setup(async () => {

0 commit comments

Comments
 (0)