executablebooks / github-activity

Simple markdown changelogs for GitHub repositories
https://github-activity.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
49 stars 11 forks source link

Load argument defaults from `.githubactivity.json` #93

Closed manics closed 3 months ago

manics commented 10 months ago

In most JupyterHub repos we use different defaults, e.g. we using heading-level 3: https://jupyterhub-team-compass.readthedocs.io/en/latest/practices/releases.html

It's normal for people to forget to pass --heading-level=3 when running github-activity.

This PR allows some config to be read from a .githubactivity.json file in the top-level of the Git clone, minimising the number of arguments that are needed. In future this could also make it easier to customise the labels or categories used instead of github-activity having to cater for everyone. Since --since already defaults to the most recent tag this potentially means no arguments would be needed when running github-activity in most cases.

To distinguish between default argparse arguments and CLI flags being explicitly set to the default value all argparse defaults are now set to None, with the actual defaults being set in load_config_and_defaults

manics commented 3 months ago

I've switched to using .githubactivity.json instead of pyproject.toml since this tool is applicable to all GitHub repos, not just Python. I've added logic to only load this from the top of the git checkout (uses git rev-parse --show-toplevel).

manics commented 3 months ago

@consideRatio I think so!