Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#85)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/pre-commit/mirrors-mypy: v1.13.0 →
v1.15.0](pre-commit/mirrors-mypy@v1.13.0...v1.15.0)
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 →
v0.9.6](astral-sh/ruff-pre-commit@v0.7.2...v0.9.6)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 11, 2025
1 parent 397ddea commit 2907ea3
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: fix-encoding-pragma
args: ["--remove"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.15.0
hooks:
- id: mypy
# TODO: Figure out how to use the same dependencies we have
Expand All @@ -27,7 +27,7 @@ repos:
]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.2
rev: v0.9.6
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To cut a new release, we use the `Release` Github Actions Workflow. This can be
![image](https://github.com/user-attachments/assets/96fc8c19-4855-4258-8565-c959317d9723)

Or with the [`gh`](https://cli.github.com) CLI:

```
gh workflow run Release --field version=0.0.33
```
Expand Down
12 changes: 6 additions & 6 deletions assistant/prdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def __fetch_instruction(self, path: Path, updated_file: Path) -> None:

if config_path.exists() and config_path.is_file():
conf = loads(config_path.read_text())
assert isinstance(
conf, MutableMapping
), f"Invalid content of {INSTRUCTIONS_CONF_FILE}"
assert isinstance(conf, MutableMapping), (
f"Invalid content of {INSTRUCTIONS_CONF_FILE}"
)
ref_path = conf.get("ref")
if ref_path:
instructions_path = path / ref_path
Expand Down Expand Up @@ -131,9 +131,9 @@ def main(argv: Sequence[str] | None = None) -> None:
args = parser.parse_args()

root = args.root
assert (
root is not None and Path(root).exists() and Path(root).is_dir()
), "The root path does not exists or is not a directory."
assert root is not None and Path(root).exists() and Path(root).is_dir(), (
"The root path does not exists or is not a directory."
)
message = InstructionsMessage(Path(root))

for path in sys.stdin:
Expand Down
6 changes: 3 additions & 3 deletions config_builder/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class YamlFileLoader(ContentLoader):
"""

def __init__(self, directory: Path) -> None:
assert (
directory.exists() and directory.is_dir()
), f"The provided path {directory} does not exists or it is not a directory"
assert directory.exists() and directory.is_dir(), (
f"The provided path {directory} does not exists or it is not a directory"
)
self.__directory = directory

def load_dict(self, file_name: str) -> Mapping[str, Any] | None:
Expand Down
6 changes: 3 additions & 3 deletions libsentrykube/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def __init__(self) -> None:
with open(config_file_name) as file:
configuration = load(file, Loader=SafeLoader)

assert (
"silo_regions" in configuration
), "silo_regions entry not present in the config"
assert "silo_regions" in configuration, (
"silo_regions entry not present in the config"
)
silo_regions = {
name: SiloRegion.from_conf(conf)
for name, conf in configuration["silo_regions"].items()
Expand Down
4 changes: 2 additions & 2 deletions libsentrykube/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def format_docs(docs: dict) -> str:


def format_people(people: list) -> str:
return ", ".join([f'{p["name"]} ({p["email"]})' for p in people])
return ", ".join([f"{p['name']} ({p['email']})" for p in people])


def format_slack_channels(slack_channels: list) -> str:
Expand All @@ -223,7 +223,7 @@ def format_slos(slos: list) -> str:
def format_teams(teams: list) -> str:
return ", ".join(
[
f'{t["display_name"]} ({t["id"]}) tags={{{",".join(t["tags"])}}}'
f"{t['display_name']} ({t['id']}) tags={{{','.join(t['tags'])}}}"
for t in teams
]
)
Expand Down
2 changes: 1 addition & 1 deletion libsentrykube/kube.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def rollout_status_deployment(
if status_replicas > updated_replicas:
return (
f"Waiting for deployment {repr(name)} rollout to finish: "
f"{status_replicas-updated_replicas} old replicas "
f"{status_replicas - updated_replicas} old replicas "
"are pending termination...",
False,
)
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
12 changes: 6 additions & 6 deletions libsentrykube/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ def duplicate_customer_dirs_in_service() -> Generator[str, None, None]:


@pytest.fixture
def regional_without_cluster_specific_override_structure() -> (
Generator[str, None, None]
):
def regional_without_cluster_specific_override_structure() -> Generator[
str, None, None
]:
"""
Creates the following folder structure:
temp_dir/
Expand Down Expand Up @@ -400,9 +400,9 @@ def regional_without_cluster_specific_override_structure() -> (


@pytest.fixture
def hierarchy_without_cluster_specific_override_structure() -> (
Generator[str, None, None]
):
def hierarchy_without_cluster_specific_override_structure() -> Generator[
str, None, None
]:
"""
Creates the following folder structure:
temp_dir/
Expand Down
6 changes: 3 additions & 3 deletions libsentrykube/tests/kubectl/test_important_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def test_process_data() -> None:

# Make sure fields are ignored
assert "generation" not in data["metadata"], "metadata.generation should be ignored"
assert (
"configVersion" not in data["spec"]["template"]["metadata"]["annotations"]
), "configVersion should be ignored"
assert "configVersion" not in data["spec"]["template"]["metadata"]["annotations"], (
"configVersion should be ignored"
)
assert all(
"image" not in container
for container in data["spec"]["template"]["spec"]["containers"]
Expand Down
6 changes: 3 additions & 3 deletions pr_approver/approver.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def main(argv: Sequence[str] | None = None) -> None:

args = parser.parse_args(argv)
config_path = args.config
assert (
Path(config_path).exists() and Path(config_path).is_file()
), f"Invalid path to a config file {config_path}. File does not exist"
assert Path(config_path).exists() and Path(config_path).is_file(), (
f"Invalid path to a config file {config_path}. File does not exist"
)

config: MutableSequence[Tuple[str, diff_approver]] = []
with open(config_path, "r") as f:
Expand Down
2 changes: 1 addition & 1 deletion sentry_kube/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def run(
listen_addr = 0.0.0.0
listen_port = 6432
unix_socket_dir =
auth_type = { "scram-sha-256" if use_auth else "trust" }
auth_type = {"scram-sha-256" if use_auth else "trust"}
auth_file = /etc/pgbouncer/userlist.txt
admin_users = {admin_user}
"""
Expand Down

0 comments on commit 2907ea3

Please sign in to comment.