Conversation
claudelog with no args now runs a report using configurable defaults (defaultReport in config.json, fallback --week) instead of printing usage. Bump to 0.3.0.
Issue templates, PR template, security policy, changelog, and updated contributing guide to match project conventions.
There was a problem hiding this comment.
Pull request overview
This PR introduces a default report feature that runs when claudelog is invoked without arguments, adds comprehensive contributing guidelines, and bumps the version to 0.3.0. The change improves user experience by providing a quick way to view recent time logs without remembering CLI flags.
Changes:
- Default report behavior:
claudelognow runs--weekreport by default instead of showing usage - Configuration: Added
defaultReportoption to customize default report flags - Documentation: Added CONTRIBUTING.md with setup, style, and testing guidelines
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bin/claudelog | Added default report dispatch logic and loadDefaultReport function |
| lib/config.mjs | Added defaultReport validation with array and string filtering |
| test/bin/claudelog.test.mjs | Restructured tests and added coverage for default report behavior |
| test/lib/config.test.mjs | Added tests for defaultReport validation |
| README.md | Updated CLI usage section with default report examples |
| CONTRIBUTING.md | New file with comprehensive contribution guidelines |
| config.example.json | Added defaultReport example configuration |
| package.json, package-lock.json, .claude-plugin/plugin.json | Version bump to 0.3.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| result.defaultReport = | ||
| result.defaultReport.filter( | ||
| (a) => typeof a === 'string' | ||
| ); |
There was a problem hiding this comment.
The validateConfig function doesn't handle the case where defaultReport becomes an empty array after filtering non-string entries (e.g., defaultReport: [42, null]). This could result in report.mjs being called with no arguments. Consider adding validation to ensure the array has at least one element, or falling back to DEFAULT_ARGS if the filtered array is empty.
| ); | |
| ); | |
| if (result.defaultReport.length === 0) { | |
| console.error( | |
| 'timelog: defaultReport must contain ' + | |
| 'at least one string entry. Ignoring.' | |
| ); | |
| delete result.defaultReport; | |
| } |
| assert.deepEqual( | ||
| cfg.defaultReport, ['--week'] | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Missing test case for empty defaultReport array (e.g., defaultReport: []). This edge case could result in report.mjs being called with no arguments, which might not behave as expected. Consider adding a test to verify the behavior when defaultReport is an empty array after filtering.
| }); | |
| }); | |
| it('handles empty array after filtering', | |
| () => { | |
| const cfg = validateConfig({ | |
| ...DEFAULT_CONFIG, | |
| defaultReport: [ | |
| 42, null, undefined, | |
| ], | |
| }); | |
| assert.strictEqual( | |
| cfg.defaultReport, undefined | |
| ); | |
| }); |
Summary
claudelogwith no arguments runs a defaultreport (
--week) instead of printing usagedefaultReportin config.json
CONTRIBUTING.md, SECURITY.md, CHANGELOG.md,
issue templates, PR template
Changes
Default report (
bin/claudelog,lib/config.mjs)report.mjswith
["--week"]defaultReportconfig option: array ofCLI flags passed to report
back to
["--week"]on invalid configCommunity files
CONTRIBUTING.md— setup, code style, TDD,PR process, conventional commits
SECURITY.md— vulnerability reporting viaGitHub Security Advisories or email
CHANGELOG.md— retroactive entries for0.1.0, 0.2.0, and unreleased changes
.github/ISSUE_TEMPLATE/bug_report.md.github/ISSUE_TEMPLATE/feature_request.md.github/PULL_REQUEST_TEMPLATE.mdDocs (
README.md,config.example.json)defaultReportdocumented in configurationVersion bump to 0.3.0
Test plan
npm testpassesnpm run lintpassesclaudelogwith no args runs weekly reportdefaultReportin config respectedclaudelog --helpmentions default behaviour