Skip to content

Commit

Permalink
fix: ruff lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Ortega <[email protected]>
  • Loading branch information
M0NsTeRRR committed Nov 18, 2024
1 parent 6c5e2a2 commit e9de06f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
22 changes: 17 additions & 5 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,23 @@
workflow_changelog = False
if "workflow" in repository_config:
workflow = True
workflow_lint = "lint" not in repository_config["workflow"] or repository_config["workflow"]["lint"]
workflow_test = "test" not in repository_config["workflow"] or repository_config["workflow"]["test"]
workflow_package = "package" not in repository_config["workflow"] or repository_config["workflow"]["package"]
workflow_changelog = "changelog" not in repository_config["workflow"] or repository_config["workflow"]["changelog"]

workflow_lint = (
"lint" not in repository_config["workflow"]
or repository_config["workflow"]["lint"]
)
workflow_test = (
"test" not in repository_config["workflow"]
or repository_config["workflow"]["test"]
)
workflow_package = (
"package" not in repository_config["workflow"]
or repository_config["workflow"]["package"]
)
workflow_changelog = (
"changelog" not in repository_config["workflow"]
or repository_config["workflow"]["changelog"]
)

devcontainer = repository_config.get("devcontainer", False)
helm = repository_config.get("helm", False)
package = "package_name" in repository_config and repository_config["package_name"]
Expand Down
8 changes: 3 additions & 5 deletions src/git_automation/GitRepositoryComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ def sync_readme(
# check if a readme already exist
r = requests.get(
f"https://api.github.com/repos/{self.owner}/{self.name}/contents/README.md",
headers = {
headers={
"Accept": "application/vnd.github.raw+json",
"Authorization": f"Bearer {os.environ["GITHUB_TOKEN"]}"
}
"Authorization": f"{os.environ["GITHUB_TOKEN"]}"
},
)
if r.status_code == 200:
template = env.from_string(self.regenerate_readme_template(r.text))
Expand Down Expand Up @@ -387,8 +387,6 @@ def sync_workflow(
):
template = env.get_template(os.path.join("workflow", "lint-pr.yml.j2"))



self._repository_file(
"workflow",
".github/workflows/lint-pr.yml",
Expand Down

0 comments on commit e9de06f

Please sign in to comment.