Skip to content

Commit

Permalink
🎨 Format Python code with Black (#2582)
Browse files Browse the repository at this point in the history
Co-authored-by: Salamandar <6552989+Salamandar@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and Salamandar authored Sep 12, 2024
1 parent 78ef9a2 commit b95c09f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
32 changes: 21 additions & 11 deletions tools/autopatches/autopatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@
my_env["GIT_TERMINAL_PROMPT"] = "0"
os.makedirs(".apps_cache", exist_ok=True)

login = (
(TOOLS_DIR / ".github_login").open("r", encoding="utf-8").read().strip()
)
token = (
(TOOLS_DIR / ".github_token").open("r", encoding="utf-8").read().strip()
)
login = (TOOLS_DIR / ".github_login").open("r", encoding="utf-8").read().strip()
token = (TOOLS_DIR / ".github_token").open("r", encoding="utf-8").read().strip()
github_api = "https://api.github.com"


Expand Down Expand Up @@ -196,11 +192,24 @@ def create_pull_request(repo, patch, base_branch, s):

def main():
parser = argparse.ArgumentParser()
parser.add_argument("the_patch", type=str, nargs="?", help="The name of the patch to apply")
parser.add_argument("--cache", "-b", action="store_true", help="Init local git clone for all apps")
parser.add_argument("--apply", "-a", action="store_true", help="Apply patch on all local clones")
parser.add_argument("--diff", "-d", action="store_true", help="Inspect diff for all apps")
parser.add_argument("--push", "-p", action="store_true", help="Push and create pull requests on all apps with non-empty diff")
parser.add_argument(
"the_patch", type=str, nargs="?", help="The name of the patch to apply"
)
parser.add_argument(
"--cache", "-b", action="store_true", help="Init local git clone for all apps"
)
parser.add_argument(
"--apply", "-a", action="store_true", help="Apply patch on all local clones"
)
parser.add_argument(
"--diff", "-d", action="store_true", help="Inspect diff for all apps"
)
parser.add_argument(
"--push",
"-p",
action="store_true",
help="Push and create pull requests on all apps with non-empty diff",
)
args = parser.parse_args()

if not (args.cache or args.apply or args.diff or args.push):
Expand All @@ -222,4 +231,5 @@ def main():
parser.error("--push requires the patch name to be passed")
push(args.the_patch)


main()
8 changes: 6 additions & 2 deletions tools/readme_generator/make_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ def generate_single_README(lang_suffix: str, lang: str):


def main():
parser = argparse.ArgumentParser(description="Automatically (re)generate README for apps")
parser.add_argument("app_path", type=Path, help="Path to the app to generate/update READMEs for")
parser = argparse.ArgumentParser(
description="Automatically (re)generate README for apps"
)
parser.add_argument(
"app_path", type=Path, help="Path to the app to generate/update READMEs for"
)
get_apps_repo.add_args(parser)
args = parser.parse_args()

Expand Down

0 comments on commit b95c09f

Please sign in to comment.