Skip to content

Commit 4c35bc2

Browse files
committed
Gitracker initial project
1 parent d62b79d commit 4c35bc2

15 files changed

Lines changed: 1230 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
23+
with:
24+
enable-cache: true
25+
26+
- name: Install dependencies
27+
run: uv sync --extra dev
28+
29+
- name: Run ruff format check
30+
run: uv run ruff format --check .
31+
32+
- name: Run ruff linting
33+
run: uv run ruff check .
34+
35+
test:
36+
name: Test Python ${{ matrix.python-version }}
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
python-version: ["3.12", "3.13"]
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Set up Python ${{ matrix.python-version }}
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v5
53+
with:
54+
enable-cache: true
55+
56+
- name: Install dependencies
57+
run: uv sync --extra dev
58+
59+
- name: Run tests
60+
run: uv run pytest -v --cov=gitrack --cov-report=xml --cov-report=term
61+
62+
- name: Upload coverage to Codecov
63+
uses: codecov/codecov-action@v4
64+
with:
65+
file: ./coverage.xml
66+
fail_ci_if_error: false
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
if: matrix.python-version == '3.12'

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
pip-wheel-metadata/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
MANIFEST
25+
26+
# Virtual environments
27+
venv/
28+
.venv/
29+
env/
30+
ENV/
31+
env.bak/
32+
venv.bak/
33+
34+
# IDEs
35+
.vscode/
36+
.idea/
37+
*.swp
38+
*.swo
39+
*~
40+
.DS_Store
41+
42+
# Testing
43+
.pytest_cache/
44+
.coverage
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
49+
# Ruff
50+
.ruff_cache/
51+
52+
# GiTrack data
53+
.gitracker/
54+
55+
# Distribution
56+
*.whl

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# GiTrack
2+
3+
[![CI](https://github.com/yourusername/gitrack/actions/workflows/ci.yml/badge.svg)](https://github.com/yourusername/gitrack/actions/workflows/ci.yml)
4+
[![codecov](https://codecov.io/gh/yourusername/gitrack/branch/main/graph/badge.svg)](https://codecov.io/gh/yourusername/gitrack)
5+
[![PyPI version](https://badge.fury.io/py/gitrack.svg)](https://badge.fury.io/py/gitrack)
6+
7+
Simple CLI tool to plan your work. Tasks are stored locally in a `.gitracker/` folder.
8+
9+
## Installation
10+
11+
```bash
12+
pip install gitrack
13+
```
14+
15+
## Usage
16+
17+
```bash
18+
$ gitrack [command] [options]
19+
```
20+
21+
## Commands
22+
23+
- `init`: Initialize a new GiTrack project
24+
- `add <task>`: Add a new task to your project
25+
- `list`: List all tasks (use `--all` to show completed tasks)
26+
- `complete <task_id>`: Mark a task as completed
27+
- `remove <task_id>`: Remove a task from your project
28+
29+
## Example
30+
31+
```bash
32+
# Initialize GiTrack in your project
33+
$ gitrack init
34+
✓ GiTrack initialized successfully!
35+
36+
# Add some tasks
37+
$ gitrack add "Implement user authentication"
38+
✓ Added task: Implement user authentication
39+
ID: a1b2c3d4
40+
41+
$ gitrack add "Write unit tests"
42+
✓ Added task: Write unit tests
43+
ID: e5f6g7h8
44+
45+
# List all pending tasks
46+
$ gitrack list
47+
48+
# Complete a task (you can use just the first few characters of the ID)
49+
$ gitrack complete a1b2
50+
51+
# List all tasks including completed ones
52+
$ gitrack list --all
53+
54+
# Remove a task
55+
$ gitrack remove e5f6
56+
```
57+
58+
## Development
59+
60+
### Setup
61+
62+
1. Clone the repository
63+
2. Install development dependencies:
64+
65+
```bash
66+
pip install -e ".[dev]"
67+
```
68+
69+
### Running Tests
70+
71+
```bash
72+
# Run all tests
73+
pytest
74+
75+
# Run with coverage
76+
pytest --cov=gitrack --cov-report=html
77+
78+
# Run specific test file
79+
pytest tests/test_cli.py
80+
```
81+
82+
### Code Quality
83+
84+
This project uses Ruff for linting and formatting:
85+
86+
```bash
87+
# Check code
88+
ruff check .
89+
90+
# Format code
91+
ruff format .
92+
93+
# Check and fix
94+
ruff check --fix .
95+
```
96+
97+
### Project Structure
98+
99+
```
100+
gitrack/
101+
├── src/
102+
│ └── gitrack/
103+
│ ├── __init__.py
104+
│ ├── cli.py # CLI interface
105+
│ ├── models.py # Data models
106+
│ └── storage.py # Storage handling
107+
├── tests/
108+
│ ├── conftest.py # Pytest fixtures
109+
│ ├── test_cli.py # CLI tests
110+
│ ├── test_models.py # Model tests
111+
│ └── test_storage.py # Storage tests
112+
├── pyproject.toml # Project configuration
113+
└── README.md
114+
```
115+
116+
### Building and Publishing
117+
118+
```bash
119+
# Build the package
120+
pip install build
121+
python -m build
122+
123+
# Upload to PyPI (requires credentials)
124+
pip install twine
125+
twine upload dist/*
126+
```
127+
128+
## License
129+
130+
MIT

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[project]
2+
name = "gitrack"
3+
version = "0.1.0"
4+
description = "Simple CLI tool to plan your work"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
authors = [
8+
{ name = "Your Name", email = "your.email@example.com" }
9+
]
10+
keywords = ["cli", "task", "planning", "productivity"]
11+
classifiers = [
12+
"Development Status :: 3 - Alpha",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: MIT License",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
]
19+
dependencies = [
20+
"click>=8.1.7",
21+
"rich>=13.7.0",
22+
]
23+
24+
[project.optional-dependencies]
25+
dev = [
26+
"pytest>=8.0.0",
27+
"pytest-cov>=4.1.0",
28+
"ruff>=0.1.0",
29+
]
30+
31+
[project.scripts]
32+
gitrack = "gitrack.cli:main"
33+
34+
[project.urls]
35+
Homepage = "https://github.com/yourusername/gitrack"
36+
Repository = "https://github.com/yourusername/gitrack"
37+
38+
[build-system]
39+
requires = ["hatchling"]
40+
build-backend = "hatchling.build"
41+
42+
[tool.hatch.build.targets.wheel]
43+
packages = ["src/gitrack"]
44+
45+
[tool.pytest.ini_options]
46+
testpaths = ["tests"]
47+
python_files = ["test_*.py"]
48+
python_classes = ["Test*"]
49+
python_functions = ["test_*"]
50+
addopts = [
51+
"--verbose",
52+
"--cov=gitrack",
53+
"--cov-report=term-missing",
54+
"--cov-report=html",
55+
]
56+
57+
[tool.ruff]
58+
line-length = 100
59+
target-version = "py312"
60+
src = ["src", "tests"]
61+
62+
[tool.ruff.lint]
63+
select = [
64+
"E", # pycodestyle errors
65+
"W", # pycodestyle warnings
66+
"F", # pyflakes
67+
"I", # isort
68+
"B", # flake8-bugbear
69+
"C4", # flake8-comprehensions
70+
"UP", # pyupgrade
71+
]
72+
ignore = [
73+
"E501", # line too long (handled by formatter)
74+
]
75+
76+
[tool.ruff.lint.per-file-ignores]
77+
"__init__.py" = ["F401"] # unused imports in __init__.py
78+
79+
[tool.ruff.format]
80+
quote-style = "double"
81+
indent-style = "space"
82+
skip-magic-trailing-comma = false
83+
line-ending = "auto"

src/gitrack/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""GiTrack - Simple CLI tool to plan your work."""
2+
3+
__version__ = "0.1.0"

0 commit comments

Comments
 (0)