Automatic style fix

Automatic style fix
This commit is contained in:
Max K 2024-07-11 09:24:25 +02:00
parent 9f1520ae21
commit 578d22ae94
7 changed files with 24 additions and 13 deletions

View File

@ -7,3 +7,4 @@ self-hosted-runner:
- stress-tester - stress-tester
- style-checker - style-checker
- style-checker-aarch64 - style-checker-aarch64
- release-maker

View File

@ -89,8 +89,8 @@ jobs:
--volume=".:/ClickHouse" clickhouse/style-test \ --volume=".:/ClickHouse" clickhouse/style-test \
/ClickHouse/tests/ci/changelog.py -v --debug-helpers \ /ClickHouse/tests/ci/changelog.py -v --debug-helpers \
--gh-user-or-token="$GH_TOKEN" --jobs=5 \ --gh-user-or-token="$GH_TOKEN" --jobs=5 \
--output="/ClickHouse/docs/changelogs/${RELEASE_TAG}.md" "${RELEASE_TAG}" --output="/ClickHouse/docs/changelogs/${{ env.RELEASE_TAG }}.md" ${{ env.RELEASE_TAG }}
git add ./docs/changelogs/${RELEASE_TAG}.md git add ./docs/changelogs/${{ env.RELEASE_TAG }}.md
echo "Generate Security" echo "Generate Security"
python3 ./utils/security-generator/generate_security.py > SECURITY.md python3 ./utils/security-generator/generate_security.py > SECURITY.md
git diff HEAD git diff HEAD

View File

@ -17,6 +17,8 @@ src_paths = ["src", "tests/ci", "tests/sqllogic"]
[tool.pylint.'MESSAGES CONTROL'] [tool.pylint.'MESSAGES CONTROL']
# pytest.mark.parametrize is not callable (not-callable) # pytest.mark.parametrize is not callable (not-callable)
disable = ''' disable = '''
pointless-string-statement,
line-too-long,
missing-docstring, missing-docstring,
too-few-public-methods, too-few-public-methods,
invalid-name, invalid-name,

View File

@ -40,7 +40,7 @@ class ShellRunner:
return 0, "" return 0, ""
print(f"Running shell command: [{command}]") print(f"Running shell command: [{command}]")
if async_: if async_:
subprocess.Popen(command.split(" ")) subprocess.Popen(command.split(" ")) # pylint:disable=consider-using-with
return 0, "" return 0, ""
result = subprocess.run( result = subprocess.run(
command + " 2>&1", command + " 2>&1",
@ -316,9 +316,9 @@ class PackageDownloader:
def __init__(self, release, commit_sha, version): def __init__(self, release, commit_sha, version):
assert version.startswith(release), "Invalid release branch or version" assert version.startswith(release), "Invalid release branch or version"
major, minor = map(int, release.split(".")) major, minor = map(int, release.split("."))
self.package_names = self.PACKAGES self.package_names = list(self.PACKAGES)
if major > 24 or (major == 24 and minor > 3): if major > 24 or (major == 24 and minor > 3):
self.package_names += self.EXTRA_PACKAGES self.package_names += list(self.EXTRA_PACKAGES)
self.release = release self.release = release
self.commit_sha = commit_sha self.commit_sha = commit_sha
self.version = version self.version = version

View File

@ -376,10 +376,10 @@ def main():
repo_urls = {} repo_urls = {}
direct_urls: Dict[str, List[str]] = {} direct_urls: Dict[str, List[str]] = {}
if pr_info.event_type == EventType.PULL_REQUEST: if pr_info.event_type == EventType.PULL_REQUEST:
release_or_pr = pr_info.number release_or_pr = str(pr_info.number)
sha = pr_info.sha sha = pr_info.sha
elif pr_info.event_type == EventType.PUSH and pr_info.is_master: elif pr_info.event_type == EventType.PUSH and pr_info.is_master:
release_or_pr = 0 release_or_pr = str(0)
sha = pr_info.sha sha = pr_info.sha
else: else:
release_or_pr = f"{args.version.major}.{args.version.minor}" release_or_pr = f"{args.version.major}.{args.version.minor}"

View File

@ -16,7 +16,15 @@ from docker_images_helper import get_docker_image, pull_image
from env_helper import IS_CI, REPO_COPY, TEMP_PATH, GITHUB_EVENT_PATH from env_helper import IS_CI, REPO_COPY, TEMP_PATH, GITHUB_EVENT_PATH
from git_helper import GIT_PREFIX, git_runner from git_helper import GIT_PREFIX, git_runner
from pr_info import PRInfo from pr_info import PRInfo
from report import ERROR, FAILURE, SUCCESS, JobReport, TestResults, read_test_results from report import (
ERROR,
FAILURE,
SUCCESS,
JobReport,
TestResults,
read_test_results,
FAIL,
)
from ssh import SSHKey from ssh import SSHKey
from stopwatch import Stopwatch from stopwatch import Stopwatch
@ -204,8 +212,8 @@ def main():
autofix_description = "" autofix_description = ""
fail_cnt = 0 fail_cnt = 0
for result in test_results: for result in test_results:
if result.status == FAILURE: if result.status in (FAILURE, FAIL):
# do not autofix if not only back failed # do not autofix if not only black failed
fail_cnt += 1 fail_cnt += 1
if args.push and fail_cnt == 1: if args.push and fail_cnt == 1:

View File

@ -711,9 +711,9 @@ def get_localzone():
class SettingsRandomizer: class SettingsRandomizer:
settings = { settings = {
"max_insert_threads": lambda: 12 "max_insert_threads": lambda: (
if random.random() < 0.03 12 if random.random() < 0.03 else random.randint(1, 3)
else random.randint(1, 3), ),
"group_by_two_level_threshold": threshold_generator(0.2, 0.2, 1, 1000000), "group_by_two_level_threshold": threshold_generator(0.2, 0.2, 1, 1000000),
"group_by_two_level_threshold_bytes": threshold_generator( "group_by_two_level_threshold_bytes": threshold_generator(
0.2, 0.2, 1, 50000000 0.2, 0.2, 1, 50000000