diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8e03113011..7eb4f103b80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ --- repos: - # - repo: 'https://github.com/rbubley/mirrors-prettier' - # rev: 'v3.2.5' - # hooks: - # - id: 'prettier' - # types_or: ['yaml', 'json', 'javascript', 'css', 'markdown'] - # always_run: true - # additional_dependencies: - # - 'prettier@3.2.5' - # - 'prettier-plugin-sort-json@4.0.0' - # pass_filenames: true - # entry: './src/scripts/pre-commit-script.sh' + - repo: 'https://github.com/rbubley/mirrors-prettier' + rev: 'v3.2.5' + hooks: + - id: 'prettier' + types_or: ['yaml', 'json', 'javascript', 'css', 'markdown'] + always_run: true + additional_dependencies: + - 'prettier@3.2.5' + - 'prettier-plugin-sort-json@4.0.0' + pass_filenames: true + entry: './src/scripts/pre-commit-script.sh' - repo: 'https://github.com/codespell-project/codespell' rev: 'v2.2.6' hooks: diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 28afd085cf6..8715dfaf08b 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -47,11 +47,11 @@ module.exports = { { files: 'src/schema-validation.json', options: { - $schema: null, - $id: null, - $comment: null, jsonRecursiveSort: true, jsonSortOrder: JSON.stringify({ + $schema: null, + $id: null, + $comment: null, ajvNotStrictMode: null, fileMatchConflict: null, highSchemaVersion: null, diff --git a/src/schema-validation.json b/src/schema-validation.json index 49e550f2434..1feb918dea3 100644 --- a/src/schema-validation.json +++ b/src/schema-validation.json @@ -1,4 +1,5 @@ { + "$schema": "./schema-validation.schema.json", "ajvNotStrictMode": [ "anywork-ac-1.0.json", "anywork-ac-1.1.json", @@ -1017,6 +1018,5 @@ "local-file" ] } - }, - "$schema": "./schema-validation.schema.json" + } } diff --git a/src/schemas/json/clang-tidy.json b/src/schemas/json/clang-tidy.json index e0f07ae069b..cd4e234235e 100644 --- a/src/schemas/json/clang-tidy.json +++ b/src/schemas/json/clang-tidy.json @@ -1,130 +1,123 @@ { - "$id": "https://json.schemastore.org/clang-tidy.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": true, - "properties": { - "CheckOptions": { - "additionalProperties": true, - "type": "object" - }, - "Checks": { - "description": "Comma-separated list of globs with optional '-' prefix. Globs are processed in order of appearance in the list. Globs without '-' prefix add checks with matching names to the set, globs with the '-' prefix remove checks with matching names from the set of enabled checks.", - "oneOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ] - }, - "ExcludeHeaderFilterRegex": { - "description": "Regular expression matching the names of the headers to exclude diagnostics from. Diagnostics from the main file of each translation unit are always displayed. Must be used together with --header-filter. Can be used together with -line-filter.", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/clang-tidy.json", + "additionalProperties": true, + "properties": { + "CheckOptions": { + "additionalProperties": true, + "type": "object" + }, + "Checks": { + "description": "Comma-separated list of globs with optional '-' prefix. Globs are processed in order of appearance in the list. Globs without '-' prefix add checks with matching names to the set, globs with the '-' prefix remove checks with matching names from the set of enabled checks.", + "oneOf": [ + { + "items": { "type": "string" + }, + "type": "array" }, - "ExtraArgs": { - "description": "Additional argument to append to the compiler command line", - "oneOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ] - }, - "ExtraArgsBefore": { - "description": "Additional argument to prepend to the compiler command line", - "oneOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ] - }, - "FormatStyle": { - "description": "Style for formatting code around applied fixes.", - "oneOf": [ - { - "enum": [ - "none", - "file", - "llvm", - "google", - "webkit", - "mozilla" - ], - "type": "string" - }, - { - "pattern": "\\{.*\\}", - "type": "string" - } - ] - }, - "HeaderFileExtensions": { - "description": "File extensions to consider to determine if a given diagnostic is located in a header file.", - "oneOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ] - }, - "HeaderFilterRegex": { - "description": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. Can be used together with -line-filter.", + { + "type": "string" + } + ] + }, + "ExcludeHeaderFilterRegex": { + "description": "Regular expression matching the names of the headers to exclude diagnostics from. Diagnostics from the main file of each translation unit are always displayed. Must be used together with --header-filter. Can be used together with -line-filter.", + "type": "string" + }, + "ExtraArgs": { + "description": "Additional argument to append to the compiler command line", + "oneOf": [ + { + "items": { "type": "string" + }, + "type": "array" }, - "ImplementationFileExtensions": { - "description": "File extensions to consider to determine if a given diagnostic is located in an implementation file.", - "oneOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "string" - } - ] - }, - "InheritParentConfig": { - "description": "If this option is true in a config file, the configuration file in the parent directory (if any exists) will be taken and the current config file will be applied on top of the parent one.", - "type": "boolean" - }, - "SystemHeaders": { - "description": "Display the errors from system headers. This option overrides the 'SystemHeaders' option in .clang-tidy file, if any.", - "type": "boolean" + { + "type": "string" + } + ] + }, + "ExtraArgsBefore": { + "description": "Additional argument to prepend to the compiler command line", + "oneOf": [ + { + "items": { + "type": "string" + }, + "type": "array" }, - "UseColor": { - "description": "Use colors in diagnostics. If not set, colors will be used if the terminal connected to standard output supports colors.", - "type": "boolean" + { + "type": "string" + } + ] + }, + "FormatStyle": { + "description": "Style for formatting code around applied fixes.", + "oneOf": [ + { + "enum": ["none", "file", "llvm", "google", "webkit", "mozilla"], + "type": "string" }, - "User": { - "description": "Specifies the name or e-mail of the user running clang-tidy. This option is used, for example, to place the correct user name in TODO() comments in the relevant checks.", + { + "pattern": "\\{.*\\}", + "type": "string" + } + ] + }, + "HeaderFileExtensions": { + "description": "File extensions to consider to determine if a given diagnostic is located in a header file.", + "oneOf": [ + { + "items": { "type": "string" + }, + "type": "array" }, - "WarningsAsErrors": { - "description": "Upgrades warnings to errors.", + { + "type": "string" + } + ] + }, + "HeaderFilterRegex": { + "description": "Regular expression matching the names of the headers to output diagnostics from. Diagnostics from the main file of each translation unit are always displayed. Can be used together with -line-filter.", + "type": "string" + }, + "ImplementationFileExtensions": { + "description": "File extensions to consider to determine if a given diagnostic is located in an implementation file.", + "oneOf": [ + { + "items": { "type": "string" + }, + "type": "array" + }, + { + "type": "string" } + ] + }, + "InheritParentConfig": { + "description": "If this option is true in a config file, the configuration file in the parent directory (if any exists) will be taken and the current config file will be applied on top of the parent one.", + "type": "boolean" + }, + "SystemHeaders": { + "description": "Display the errors from system headers. This option overrides the 'SystemHeaders' option in .clang-tidy file, if any.", + "type": "boolean" + }, + "UseColor": { + "description": "Use colors in diagnostics. If not set, colors will be used if the terminal connected to standard output supports colors.", + "type": "boolean" + }, + "User": { + "description": "Specifies the name or e-mail of the user running clang-tidy. This option is used, for example, to place the correct user name in TODO() comments in the relevant checks.", + "type": "string" }, - "type": "object" + "WarningsAsErrors": { + "description": "Upgrades warnings to errors.", + "type": "string" + } + }, + "type": "object" } diff --git a/src/test/clang-tidy/dump-clang-tidy.yaml b/src/test/clang-tidy/dump-clang-tidy.yaml index 94f64b9ffe9..85f05373c2c 100644 --- a/src/test/clang-tidy/dump-clang-tidy.yaml +++ b/src/test/clang-tidy/dump-clang-tidy.yaml @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*' +Checks: 'clang-diagnostic-*,clang-analyzer-*' WarningsAsErrors: '' HeaderFileExtensions: - '' @@ -13,8 +13,8 @@ ImplementationFileExtensions: - cpp - cxx HeaderFilterRegex: '' -FormatStyle: none -User: Schemastore +FormatStyle: none +User: Schemastore CheckOptions: cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU' cert-err33-c.AllowCastToVoid: 'true' @@ -29,6 +29,4 @@ CheckOptions: llvm-else-after-return.WarnOnConditionVariables: 'false' llvm-else-after-return.WarnOnUnfixable: 'false' llvm-qualified-auto.AddConstToQualified: 'false' -SystemHeaders: false -... - +SystemHeaders: false