MCPcopy
hub / github.com/ActivityWatch/activitywatch / main

Function main

scripts/build_changelog.py:44–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43
44def main():
45 parser = argparse.ArgumentParser(description="Generate changelog from git history")
46
47 # repo info
48 parser.add_argument("--org", default="ActivityWatch", help="GitHub organization")
49 parser.add_argument("--repo", default="activitywatch", help="GitHub repository")
50 parser.add_argument(
51 "--project-title", default="ActivityWatch", help="Project title"
52 )
53
54 # settings
55 last_tag = run("git describe --tags --abbrev=0").strip() # get latest tag
56 branch = run("git rev-parse --abbrev-ref HEAD").strip() # get current branch name
57 parser.add_argument(
58 "--range", default=f"{last_tag}...{branch}", help="Git commit range"
59 )
60 parser.add_argument("--path", default=".", help="Path to git repo")
61
62 # output
63 parser.add_argument(
64 "--output", default="changelog.md", help="Path to output changelog"
65 )
66 parser.add_argument(
67 "--add-version-header",
68 action="store_true",
69 help="Add version header and adjust heading levels for docs",
70 )
71
72 # parse args
73 args = parser.parse_args()
74 since, until = args.range.split("...", 1)
75
76 # preferred output order for submodules
77 repo_order = [
78 "activitywatch",
79 "aw-server",
80 "aw-server-rust",
81 "aw-webui",
82 "aw-watcher-afk",
83 "aw-watcher-window",
84 "aw-qt",
85 "aw-core",
86 "aw-client",
87 ]
88
89 build(
90 args.org,
91 args.repo,
92 args.project_title,
93 commit_range=(since, until),
94 output_path=args.output,
95 repo_order=repo_order,
96 add_version_header=args.add_version_header,
97 )
98
99
100class CommitMsg:

Callers 1

build_changelog.pyFile · 0.70

Calls 2

runFunction · 0.85
buildFunction · 0.85

Tested by

no test coverage detected