Skip to content

Commit 00041db

Browse files
authored
docs: add initial CHANGELOG and CONTRIBUTING guidelines
docs: add initial CHANGELOG and CONTRIBUTING guidelines
2 parents fe6e660 + de55886 commit 00041db

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
## [1.1.0] - 2025-05-27
4+
5+
### Added
6+
- Support for time-based log rotation via `RotationInterval` configuration
7+
- Rotation reason (`-time`, `-size`) included in backup filenames
8+
- Platform-specific file ownership preservation (`chown_linux.go`)
9+
- Enhanced filename parsing to recognize timestamp and rotation reason
10+
- Extensive unit tests for time-based rotation, compression, and ownership
11+
- Default filename uses `-timberjack.log` if none is provided
12+
13+
### Changed
14+
- Refactored rotation logic to support time-based, size-based, and manual triggers uniformly
15+
- Replaced deprecated `ioutil.ReadDir` with modern `os.ReadDir`
16+
- Improved compression logic to handle chown and cleanup safely
17+
18+
### Fixed
19+
- Preserved original file mode and ownership during rotation and compression
20+
- Resolved edge cases in backup name parsing with improved robustness
21+
22+
### Removed
23+
- Legacy logic relying solely on size-based rotation

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing to Timberjack
2+
3+
Thank you for considering contributing to **Timberjack**! Please take a moment to read through these guidelines.
4+
5+
## Guidelines
6+
7+
- All contributions must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) format.
8+
- Ensure all tests pass before pushing or opening a pull request.
9+
- Document new functionality clearly in code comments and README if applicable.
10+
- Avoid unnecessary commits or unrelated changes.
11+
12+
## Commit Message Format
13+
14+
We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard:
15+
16+
```
17+
<type>[optional scope]: <description>
18+
```
19+
### Examples
20+
21+
- `feat: add Rotate feature`
22+
- `fix: correct rotation timestamp logic`
23+
- `docs: update README with usage example`
24+
- `test: cover edge case for rotation overlap`
25+
26+
### Allowed Types
27+
28+
| Type | Use For |
29+
|-----------|-------------------------------------------------------------------------|
30+
| `feat` | A new feature |
31+
| `fix` | A bug fix |
32+
| `chore` | Build process, CI, tooling |
33+
| `docs` | Changes to documentation (README, comments) |
34+
| `test` | Adding or modifying tests |
35+
| `refactor`| Code refactoring without behavior change |
36+
| `style` | Code style changes (whitespace, etc) |
37+
| `perf` | Performance improvements |
38+
| `ci` | Changes to GitHub Actions, CI/CD workflows |
39+
40+
41+
## Scopes (Optional)
42+
43+
Use a **scope** in parentheses after the type to clarify what part of the code is affected. Examples:
44+
45+
- `fix(logger): correct timestamp handling`
46+
- `feat(rotation): add weekday scheduling`
47+
- `docs(readme): document Rotate usage`
48+
49+
### Breaking Changes
50+
51+
If your commit introduces a **breaking change** — something that would require users to modify their code — add a `!` immediately after the type:
52+
53+
- `feat!: remove support for deprecated config field`
54+
55+
This will mark the commit as a major version bump when release automation is used.
56+
57+
### Other Guidelines
58+
59+
- Run all tests before pushing: `go test ./...`
60+
- Keep PRs focused and self-contained
61+
- Use clear, descriptive commit messages
62+
- If you add a new feature, consider adding an example in the README.

0 commit comments

Comments
 (0)