Skip to content

Commit 2e6802c

Browse files
authored
Merge pull request #161 from ghinks/codex/add-configuration-file-support-for-review-tally-tmkr25
fix: resolve config parsing lint and typing
2 parents fe31dba + b4fc76d commit 2e6802c

File tree

5 files changed

+567
-123
lines changed

5 files changed

+567
-123
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ review-tally -o expressjs --languages javascript --plot-individual --save-plot r
167167

168168
## Options
169169

170+
* -c, --config Path to a TOML configuration file containing CLI options
170171
* -o, --org The GitHub organization that you want to query
171172
* -l, --languages A comma separated list of languages that you want to include
172173
* -s, --start-date The start date for the time frame that you want to query (optional)
@@ -187,6 +188,45 @@ review-tally -o expressjs --languages javascript --plot-individual --save-plot r
187188
* --clear-expired-cache Clear only expired cached data and exit
188189
* --cache-stats Show cache statistics and exit
189190

191+
## Configuration files
192+
193+
You can provide all CLI options via a TOML configuration file by passing the `--config` flag. Each setting uses the same name (with dashes) as
194+
its corresponding long-form CLI option, and command line values continue to override anything defined in the file. In addition
195+
to the existing switches, configuration files support a `repositories` list that lets you target specific repositories without
196+
providing an organization. Repositories must be defined in `owner/repository-name` format.
197+
198+
Example configuration:
199+
200+
```toml
201+
# basic time window and filters
202+
start-date = "2023-01-01"
203+
end-date = "2023-01-15"
204+
languages = ["python", "javascript"]
205+
metrics = ["reviews", "comments"]
206+
207+
# sprint analysis output and plotting
208+
sprint-analysis = true
209+
output-path = "sprint.csv"
210+
plot-sprint = true
211+
chart-type = "line"
212+
chart-metrics = ["total_reviews", "unique_reviewers"]
213+
save-plot = "sprint_plot.html"
214+
215+
# caching controls
216+
no-cache = true
217+
clear-cache = true
218+
clear-expired-cache = true
219+
cache-stats = true
220+
221+
# repositories to process (no --org needed)
222+
repositories = [
223+
"octocat/hello-world",
224+
"cli/review-tally",
225+
]
226+
```
227+
228+
When `repositories` is supplied the tool skips organization discovery and queries each repository owner pair directly.
229+
190230
## GitHub API Rate Limiting
191231

192232
This tool uses GitHub's REST and GraphQL APIs extensively to gather pull request and review data. GitHub enforces rate limits to ensure fair usage of their API resources.

0 commit comments

Comments
 (0)