Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.2
rev: v0.8.0
hooks:
# Run the linter.
- id: ruff
Expand Down
7 changes: 4 additions & 3 deletions libsentrykube/kubectl/important_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ def process_folder(folder: str) -> Dict[str, List[ApplyResult]]:
for filename in filenames:
full_path = os.path.join(dirpath, filename)

with open(full_path) as input_file, tempfile.NamedTemporaryFile(
mode="w", delete=False
) as output_stream:
with (
open(full_path) as input_file,
tempfile.NamedTemporaryFile(mode="w", delete=False) as output_stream,
):
file_apply_results[filename] = process_file(
full_path, input_file, output_stream
)
Expand Down
9 changes: 6 additions & 3 deletions sentry_kube/cli/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,12 @@ def _dump_yaml_docs_to_tmpdir(yaml_docs: List[str]) -> Iterator[str]:
# NOTE: our dummy threading implementation might change the order of diff output.
# If you really need sorted diff like native kubectl diff, then you would need
# to set concurrency to 1
with contextlib.ExitStack() as stack, concurrent.futures.ThreadPoolExecutor(
max_workers=KUBECTL_DIFF_CONCURRENCY
) as executor:
with (
contextlib.ExitStack() as stack,
concurrent.futures.ThreadPoolExecutor(
max_workers=KUBECTL_DIFF_CONCURRENCY
) as executor,
):
chunk_size = max(len(yaml_docs) // KUBECTL_DIFF_CONCURRENCY, 1)
kubectl_diff_cmds = [
cmd
Expand Down