Skip to content

Commit 714d305

Browse files
ci,docs: add CI workflow, style guide, and improve documentation structure
1 parent 63c9c7c commit 714d305

File tree

3 files changed

+129
-1
lines changed

3 files changed

+129
-1
lines changed

.github/workflows/python-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -r requirements.txt
22+
pip install pytest flake8 mypy
23+
- name: Lint with flake8
24+
run: |
25+
flake8 src/ tests/
26+
- name: Type check with mypy
27+
run: |
28+
mypy src/
29+
- name: Test with pytest
30+
run: |
31+
pytest tests/

docs/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# HyprRice Documentation
22

3+
[![Python CI](https://github.com/DuckyOnQuack-999/HyprRice/actions/workflows/python-ci.yml/badge.svg)](https://github.com/DuckyOnQuack-999/HyprRice/actions/workflows/python-ci.yml)
4+
35
Welcome to the HyprRice documentation! This guide will help you navigate the available documentation resources.
46

7+
## Table of Contents
8+
- [Core Documentation](#core-documentation)
9+
- [Tutorials](#tutorials)
10+
- [Reference](#reference)
11+
- [How-To Guides](#how-to-guides)
12+
- [Development](#development)
13+
- [Examples](#examples)
14+
- [Style Guide](#style-guide)
15+
516
## 📚 Core Documentation
617

718
- [User Guide](user_guide.md) - Complete guide to using HyprRice
@@ -36,4 +47,12 @@ Welcome to the HyprRice documentation! This guide will help you navigate the ava
3647

3748
- [Example Themes](../themes/) - Pre-installed themes
3849
- [Example Plugins](examples/plugins/) - Sample plugin implementations
39-
- [Configuration Examples](examples/configs/) - Common configuration patterns
50+
- [Configuration Examples](examples/configs/) - Common configuration patterns
51+
52+
## 📝 Style Guide
53+
54+
- [Documentation & Code Style Guide](STYLE_GUIDE.md)
55+
56+
---
57+
58+
For more, see the [main repository](https://github.com/DuckyOnQuack-999/HyprRice) and the [README](../README.md).

docs/STYLE_GUIDE.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# HyprRice Style Guide
2+
3+
## Documentation Style
4+
5+
- Use Markdown for all documentation files.
6+
- Start each doc with a top-level heading (`# Title`).
7+
- Use second-level headings (`##`) for major sections.
8+
- Use bullet points for lists, numbered lists for steps.
9+
- Use fenced code blocks for code and commands.
10+
- Reference files and classes as `filename.py`, `ClassName`.
11+
- Use relative links for docs and images.
12+
- Add a Table of Contents for docs longer than 2 pages.
13+
- Use screenshots in `docs/screenshots/` and reference them inline.
14+
- Cross-link related docs for easy navigation.
15+
16+
## Code Style
17+
18+
- Follow [PEP 8](https://peps.python.org/pep-0008/) for Python code.
19+
- Use type hints for all functions and methods.
20+
- Use Google-style docstrings for all public functions/classes.
21+
- Keep functions focused and small.
22+
- Use descriptive variable and function names.
23+
- Group imports: standard library, third-party, local.
24+
- Use `snake_case` for variables/functions, `CamelCase` for classes.
25+
- Document exceptions and side effects.
26+
27+
## Naming Conventions
28+
29+
- Files: `lowercase_with_underscores.py`
30+
- Classes: `CamelCase`
31+
- Functions/variables: `snake_case`
32+
- Constants: `UPPERCASE`
33+
34+
## Example Docstring
35+
36+
```python
37+
from typing import Dict, Any
38+
39+
def process_config(config: Dict[str, Any]) -> bool:
40+
"""
41+
Process and validate configuration.
42+
43+
Args:
44+
config (Dict[str, Any]): Configuration dictionary.
45+
46+
Returns:
47+
bool: True if valid, False otherwise.
48+
"""
49+
if not isinstance(config, dict):
50+
return False
51+
return True
52+
```
53+
54+
## Screenshot Guidelines
55+
56+
- Save images in `docs/screenshots/`.
57+
- Use descriptive filenames (e.g., `main_window.png`).
58+
- Reference with `![Alt text](../screenshots/main_window.png)`.
59+
- Add captions below screenshots if needed.
60+
61+
## Markdown Example
62+
63+
````markdown
64+
# Section Title
65+
66+
## Subsection
67+
68+
- Use bullet points for lists.
69+
- Use fenced code blocks for code.
70+
- Reference files as `filename.py`.
71+
- Use relative links for docs.
72+
````
73+
74+
## Pull Requests & Reviews
75+
76+
- Ensure all new code and docs follow this style guide.
77+
- Reviewers should check for style, clarity, and consistency.
78+
- Update this guide as the project evolves.

0 commit comments

Comments
 (0)