Enhance Code Consistency Across Repository with .editorconfig (#19023)

This commit is contained in:
QuantumGhost 2025-04-29 18:04:33 +08:00 committed by GitHub
parent 226afd4550
commit bd1bbfee4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
274 changed files with 1271 additions and 1217 deletions

View File

@ -5,18 +5,35 @@ root = true
# Unix-style newlines with a newline ending every file # Unix-style newlines with a newline ending every file
[*] [*]
charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true
[*.py]
indent_size = 4
indent_style = space
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.toml]
indent_size = 4
indent_style = space
# Markdown and MDX are whitespace sensitive languages.
# Do not remove trailing spaces.
[*.{md,mdx}]
trim_trailing_whitespace = false
# Matches multiple files with brace expansion notation # Matches multiple files with brace expansion notation
# Set default charset # Set default charset
[*.{js,tsx}] [*.{js,tsx}]
charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
# Matches the exact files package.json
# Matches the exact files either package.json or .travis.yml [package.json]
[{package.json,.travis.yml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

View File

@ -0,0 +1,22 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAfterTabs": false,
"NoColor": false,
"Exclude": [
"^web/public/vs/",
"^web/public/pdf.worker.min.mjs$",
"web/app/components/base/icons/src/vender/"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"IndentSize": true,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"MaxLineLength": false
}
}

View File

@ -9,6 +9,12 @@ concurrency:
group: style-${{ github.head_ref || github.run_id }} group: style-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
permissions:
checks: write
statuses: write
contents: read
jobs: jobs:
python-style: python-style:
name: Python Style name: Python Style
@ -163,3 +169,14 @@ jobs:
VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_XML: true VALIDATE_XML: true
VALIDATE_YAML: true VALIDATE_YAML: true
- name: EditorConfig checks
uses: super-linter/super-linter/slim@v7
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GENERATED_FILES: true
IGNORE_GITIGNORED_FILES: true
# EditorConfig validation
VALIDATE_EDITORCONFIG: true
EDITORCONFIG_FILE_NAME: editorconfig-checker.json

View File

@ -444,13 +444,13 @@ def convert_to_agent_apps():
WHERE a.mode = 'chat' WHERE a.mode = 'chat'
AND am.agent_mode is not null AND am.agent_mode is not null
AND ( AND (
am.agent_mode like '%"strategy": "function_call"%' am.agent_mode like '%"strategy": "function_call"%'
OR am.agent_mode like '%"strategy": "react"%' OR am.agent_mode like '%"strategy": "react"%'
) )
AND ( AND (
am.agent_mode like '{"enabled": true%' am.agent_mode like '{"enabled": true%'
OR am.agent_mode like '{"max_iteration": %' OR am.agent_mode like '{"max_iteration": %'
) ORDER BY a.created_at DESC LIMIT 1000 ) ORDER BY a.created_at DESC LIMIT 1000
""" """
with db.engine.begin() as conn: with db.engine.begin() as conn:

View File

@ -37,4 +37,3 @@
white-space: pre-line; white-space: pre-line;
word-break: break-all; word-break: break-all;
} }

View File

@ -31,4 +31,3 @@
.fileContent { .fileContent {
white-space: pre-line; white-space: pre-line;
} }