lifx-emulator 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lifx_emulator-1.0.0/.github/workflows/ci.yml +188 -0
- lifx_emulator-1.0.0/.github/workflows/docs.yml +111 -0
- lifx_emulator-1.0.0/.gitignore +94 -0
- lifx_emulator-1.0.0/.pre-commit-config.yaml +101 -0
- lifx_emulator-1.0.0/CLAUDE.md +603 -0
- lifx_emulator-1.0.0/LICENSE +35 -0
- lifx_emulator-1.0.0/PKG-INFO +445 -0
- lifx_emulator-1.0.0/README.md +417 -0
- lifx_emulator-1.0.0/docs/advanced/device-management-api.md +658 -0
- lifx_emulator-1.0.0/docs/advanced/scenario-api.md +809 -0
- lifx_emulator-1.0.0/docs/advanced/scenarios.md +406 -0
- lifx_emulator-1.0.0/docs/advanced/storage.md +291 -0
- lifx_emulator-1.0.0/docs/api/device.md +489 -0
- lifx_emulator-1.0.0/docs/api/factories.md +340 -0
- lifx_emulator-1.0.0/docs/api/index.md +199 -0
- lifx_emulator-1.0.0/docs/api/products.md +539 -0
- lifx_emulator-1.0.0/docs/api/protocol.md +718 -0
- lifx_emulator-1.0.0/docs/api/server.md +437 -0
- lifx_emulator-1.0.0/docs/api/storage.md +680 -0
- lifx_emulator-1.0.0/docs/architecture/device-state.md +3 -0
- lifx_emulator-1.0.0/docs/architecture/overview.md +373 -0
- lifx_emulator-1.0.0/docs/architecture/packet-flow.md +3 -0
- lifx_emulator-1.0.0/docs/architecture/protocol.md +3 -0
- lifx_emulator-1.0.0/docs/assets/favicon.png +1 -0
- lifx_emulator-1.0.0/docs/changelog.md +7 -0
- lifx_emulator-1.0.0/docs/faq.md +574 -0
- lifx_emulator-1.0.0/docs/getting-started/cli.md +356 -0
- lifx_emulator-1.0.0/docs/getting-started/installation.md +165 -0
- lifx_emulator-1.0.0/docs/getting-started/quickstart.md +182 -0
- lifx_emulator-1.0.0/docs/guide/best-practices.md +696 -0
- lifx_emulator-1.0.0/docs/guide/device-types.md +355 -0
- lifx_emulator-1.0.0/docs/guide/integration-testing.md +788 -0
- lifx_emulator-1.0.0/docs/guide/overview.md +62 -0
- lifx_emulator-1.0.0/docs/guide/products-and-specs.md +229 -0
- lifx_emulator-1.0.0/docs/guide/testing-scenarios.md +673 -0
- lifx_emulator-1.0.0/docs/guide/web-interface.md +490 -0
- lifx_emulator-1.0.0/docs/index.md +83 -0
- lifx_emulator-1.0.0/docs/reference/glossary.md +352 -0
- lifx_emulator-1.0.0/docs/reference/troubleshooting.md +845 -0
- lifx_emulator-1.0.0/docs/stylesheets/extra.css +37 -0
- lifx_emulator-1.0.0/docs/tutorials/01-first-device.md +261 -0
- lifx_emulator-1.0.0/docs/tutorials/02-basic.md +345 -0
- lifx_emulator-1.0.0/docs/tutorials/03-advanced.md +583 -0
- lifx_emulator-1.0.0/docs/tutorials/04-integration.md +642 -0
- lifx_emulator-1.0.0/docs/tutorials/05-cicd.md +696 -0
- lifx_emulator-1.0.0/docs/tutorials/index.md +108 -0
- lifx_emulator-1.0.0/mkdocs.yml +212 -0
- lifx_emulator-1.0.0/pyproject.toml +149 -0
- lifx_emulator-1.0.0/renovate.json +161 -0
- lifx_emulator-1.0.0/src/lifx_emulator/__init__.py +31 -0
- lifx_emulator-1.0.0/src/lifx_emulator/__main__.py +607 -0
- lifx_emulator-1.0.0/src/lifx_emulator/api.py +1825 -0
- lifx_emulator-1.0.0/src/lifx_emulator/async_storage.py +308 -0
- lifx_emulator-1.0.0/src/lifx_emulator/constants.py +33 -0
- lifx_emulator-1.0.0/src/lifx_emulator/device.py +750 -0
- lifx_emulator-1.0.0/src/lifx_emulator/device_states.py +114 -0
- lifx_emulator-1.0.0/src/lifx_emulator/factories.py +380 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/__init__.py +39 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/base.py +49 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/device_handlers.py +340 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/light_handlers.py +372 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/multizone_handlers.py +249 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/registry.py +110 -0
- lifx_emulator-1.0.0/src/lifx_emulator/handlers/tile_handlers.py +309 -0
- lifx_emulator-1.0.0/src/lifx_emulator/observers.py +139 -0
- lifx_emulator-1.0.0/src/lifx_emulator/products/__init__.py +28 -0
- lifx_emulator-1.0.0/src/lifx_emulator/products/generator.py +771 -0
- lifx_emulator-1.0.0/src/lifx_emulator/products/registry.py +1446 -0
- lifx_emulator-1.0.0/src/lifx_emulator/products/specs.py +242 -0
- lifx_emulator-1.0.0/src/lifx_emulator/products/specs.yml +327 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/__init__.py +1 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/base.py +334 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/const.py +8 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/generator.py +1371 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/header.py +159 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/packets.py +1351 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/protocol_types.py +844 -0
- lifx_emulator-1.0.0/src/lifx_emulator/protocol/serializer.py +379 -0
- lifx_emulator-1.0.0/src/lifx_emulator/scenario_manager.py +402 -0
- lifx_emulator-1.0.0/src/lifx_emulator/scenario_persistence.py +206 -0
- lifx_emulator-1.0.0/src/lifx_emulator/server.py +482 -0
- lifx_emulator-1.0.0/src/lifx_emulator/state_restorer.py +259 -0
- lifx_emulator-1.0.0/src/lifx_emulator/state_serializer.py +130 -0
- lifx_emulator-1.0.0/src/lifx_emulator/storage_protocol.py +100 -0
- lifx_emulator-1.0.0/tests/conftest.py +235 -0
- lifx_emulator-1.0.0/tests/test_api.py +629 -0
- lifx_emulator-1.0.0/tests/test_async_storage.py +246 -0
- lifx_emulator-1.0.0/tests/test_cli.py +899 -0
- lifx_emulator-1.0.0/tests/test_cli_validation.py +389 -0
- lifx_emulator-1.0.0/tests/test_device.py +542 -0
- lifx_emulator-1.0.0/tests/test_device_edge_cases.py +231 -0
- lifx_emulator-1.0.0/tests/test_device_handlers_extended.py +732 -0
- lifx_emulator-1.0.0/tests/test_handler_registry.py +103 -0
- lifx_emulator-1.0.0/tests/test_integration.py +464 -0
- lifx_emulator-1.0.0/tests/test_light_handlers_extended.py +788 -0
- lifx_emulator-1.0.0/tests/test_multizone_handlers_extended.py +560 -0
- lifx_emulator-1.0.0/tests/test_observers.py +164 -0
- lifx_emulator-1.0.0/tests/test_products_generator.py +1104 -0
- lifx_emulator-1.0.0/tests/test_protocol_generator.py +815 -0
- lifx_emulator-1.0.0/tests/test_protocol_types_coverage.py +118 -0
- lifx_emulator-1.0.0/tests/test_scenario_manager.py +431 -0
- lifx_emulator-1.0.0/tests/test_scenario_persistence.py +271 -0
- lifx_emulator-1.0.0/tests/test_serializer.py +460 -0
- lifx_emulator-1.0.0/tests/test_server.py +512 -0
- lifx_emulator-1.0.0/tests/test_state_restorer.py +270 -0
- lifx_emulator-1.0.0/tests/test_tile_handlers_extended.py +664 -0
- lifx_emulator-1.0.0/uv.lock +1325 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
PYTHON_VERSION: '3.11'
|
|
12
|
+
UV_VERSION: 0.9.4
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# Code quality checks
|
|
16
|
+
quality:
|
|
17
|
+
name: Code Quality
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v6
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v7
|
|
29
|
+
with:
|
|
30
|
+
version: ${{ env.UV_VERSION }}
|
|
31
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: uv sync --frozen
|
|
35
|
+
|
|
36
|
+
- name: Run Ruff format check
|
|
37
|
+
run: uv run ruff format --check .
|
|
38
|
+
|
|
39
|
+
- name: Run Ruff linter
|
|
40
|
+
run: uv run ruff check .
|
|
41
|
+
|
|
42
|
+
- name: Run Pyright type checker
|
|
43
|
+
run: uv run pyright
|
|
44
|
+
|
|
45
|
+
- name: Check for security issues
|
|
46
|
+
run: |
|
|
47
|
+
uv pip install bandit
|
|
48
|
+
uv run bandit -r src/
|
|
49
|
+
|
|
50
|
+
# Testing matrix across Python versions and platforms
|
|
51
|
+
test:
|
|
52
|
+
name: Test (Python ${{ matrix.python-version }} on ${{ matrix.os }})
|
|
53
|
+
runs-on: ${{ matrix.os }}
|
|
54
|
+
strategy:
|
|
55
|
+
fail-fast: false
|
|
56
|
+
matrix:
|
|
57
|
+
os: [ubuntu-latest, macos-latest]
|
|
58
|
+
python-version: ['3.11', '3.12', '3.13', '3.14']
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@v5
|
|
61
|
+
|
|
62
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
63
|
+
uses: actions/setup-python@v6
|
|
64
|
+
with:
|
|
65
|
+
python-version: ${{ matrix.python-version }}
|
|
66
|
+
|
|
67
|
+
- name: Install uv
|
|
68
|
+
uses: astral-sh/setup-uv@v7
|
|
69
|
+
with:
|
|
70
|
+
version: ${{ env.UV_VERSION }}
|
|
71
|
+
python-version: ${{ matrix.python-version }}
|
|
72
|
+
enable-cache: true
|
|
73
|
+
|
|
74
|
+
- name: Install dependencies
|
|
75
|
+
run: uv sync --frozen
|
|
76
|
+
|
|
77
|
+
- name: Run unit tests
|
|
78
|
+
run: uv run --frozen pytest
|
|
79
|
+
|
|
80
|
+
- name: Upload coverage to Codecov
|
|
81
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
82
|
+
uses: codecov/codecov-action@v5
|
|
83
|
+
with:
|
|
84
|
+
slug: Djelibeybi/lifx-async
|
|
85
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
86
|
+
fail_ci_if_error: false
|
|
87
|
+
|
|
88
|
+
- name: Upload test results to Codecov
|
|
89
|
+
if: ${{ !cancelled() }}
|
|
90
|
+
uses: codecov/test-results-action@v1
|
|
91
|
+
with:
|
|
92
|
+
fail_ci_if_error: false
|
|
93
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
94
|
+
|
|
95
|
+
release:
|
|
96
|
+
needs:
|
|
97
|
+
- quality
|
|
98
|
+
- test
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
|
|
101
|
+
permissions:
|
|
102
|
+
id-token: write
|
|
103
|
+
contents: write
|
|
104
|
+
|
|
105
|
+
concurrency:
|
|
106
|
+
group: ${{ github.workflow }}-release-${{ github.ref_name }}
|
|
107
|
+
cancel-in-progress: false
|
|
108
|
+
|
|
109
|
+
outputs:
|
|
110
|
+
released: ${{ steps.release.outputs.released || 'false' }}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
steps:
|
|
114
|
+
- name: Checkout repository on release branch
|
|
115
|
+
uses: actions/checkout@v5
|
|
116
|
+
with:
|
|
117
|
+
ref: ${{ github.head_ref || github.ref_name }}
|
|
118
|
+
fetch-depth: 0
|
|
119
|
+
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
|
120
|
+
|
|
121
|
+
- name: Set up Python
|
|
122
|
+
uses: actions/setup-python@v6
|
|
123
|
+
with:
|
|
124
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
125
|
+
|
|
126
|
+
- name: Install uv
|
|
127
|
+
uses: astral-sh/setup-uv@v7
|
|
128
|
+
with:
|
|
129
|
+
version: ${{ env.UV_VERSION }}
|
|
130
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
131
|
+
|
|
132
|
+
- name: Configure git
|
|
133
|
+
run: |
|
|
134
|
+
git config --local user.email "github-actions@github.com"
|
|
135
|
+
git config --local user.name "GitHub Actions"
|
|
136
|
+
|
|
137
|
+
- name: Run Python Semantic Release (NOOP)
|
|
138
|
+
id: psr-noop
|
|
139
|
+
if: github.ref_name != 'main'
|
|
140
|
+
env:
|
|
141
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
142
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
143
|
+
run: |
|
|
144
|
+
uv run --with python-semantic-release semantic-release --noop version
|
|
145
|
+
|
|
146
|
+
- name: Run Python Semantic Release
|
|
147
|
+
id: release
|
|
148
|
+
if: github.ref_name == 'main'
|
|
149
|
+
env:
|
|
150
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
151
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
152
|
+
run: |
|
|
153
|
+
uv run --with python-semantic-release semantic-release version
|
|
154
|
+
|
|
155
|
+
- name: Upload Distribution Artifacts
|
|
156
|
+
uses: actions/upload-artifact@v5
|
|
157
|
+
with:
|
|
158
|
+
name: distribution-artifacts
|
|
159
|
+
path: dist
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
deploy:
|
|
163
|
+
runs-on: ubuntu-latest
|
|
164
|
+
needs: release
|
|
165
|
+
if: ${{ needs.release.outputs.released == 'true' }}
|
|
166
|
+
|
|
167
|
+
permissions:
|
|
168
|
+
contents: read
|
|
169
|
+
id-token: write
|
|
170
|
+
|
|
171
|
+
environment:
|
|
172
|
+
name: pypi
|
|
173
|
+
url: https://pypi.org/p/lifx-emulator
|
|
174
|
+
|
|
175
|
+
steps:
|
|
176
|
+
- name: Download Build Artifacts
|
|
177
|
+
uses: actions/download-artifact@v6
|
|
178
|
+
id: artifact-download
|
|
179
|
+
with:
|
|
180
|
+
name: distribution-artifacts
|
|
181
|
+
path: dist
|
|
182
|
+
|
|
183
|
+
- name: Publish package distributions to PyPI
|
|
184
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
185
|
+
with:
|
|
186
|
+
packages-dir: dist
|
|
187
|
+
print-hash: true
|
|
188
|
+
verbose: true
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- docs/**
|
|
9
|
+
- src/lifx_emulator/**
|
|
10
|
+
- mkdocs.yml
|
|
11
|
+
- .github/workflows/docs.yml
|
|
12
|
+
pull_request:
|
|
13
|
+
paths:
|
|
14
|
+
- docs/**
|
|
15
|
+
- mkdocs.yml
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PYTHON_VERSION: '3.11'
|
|
19
|
+
UV_VERSION: 0.9.4
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
build-docs:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v5
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # Fetch all history for git-revision-date-localized
|
|
31
|
+
|
|
32
|
+
- name: Set up Python
|
|
33
|
+
uses: actions/setup-python@v6
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
uses: astral-sh/setup-uv@v7
|
|
39
|
+
with:
|
|
40
|
+
version: ${{ env.UV_VERSION }}
|
|
41
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: |
|
|
45
|
+
uv sync --frozen
|
|
46
|
+
|
|
47
|
+
- name: Build documentation
|
|
48
|
+
run: uv run mkdocs build
|
|
49
|
+
|
|
50
|
+
- name: Upload docs artifact
|
|
51
|
+
if: github.event_name == 'pull_request'
|
|
52
|
+
uses: actions/upload-artifact@v5
|
|
53
|
+
with:
|
|
54
|
+
name: docs
|
|
55
|
+
path: site/
|
|
56
|
+
|
|
57
|
+
deploy-docs:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
60
|
+
needs: build-docs
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v5
|
|
63
|
+
with:
|
|
64
|
+
fetch-depth: 0
|
|
65
|
+
|
|
66
|
+
- name: Set up Python
|
|
67
|
+
uses: actions/setup-python@v6
|
|
68
|
+
with:
|
|
69
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
70
|
+
|
|
71
|
+
- name: Install uv
|
|
72
|
+
uses: astral-sh/setup-uv@v7
|
|
73
|
+
with:
|
|
74
|
+
version: ${{ env.UV_VERSION }}
|
|
75
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
76
|
+
|
|
77
|
+
- name: Install dependencies
|
|
78
|
+
run: |
|
|
79
|
+
uv sync --frozen
|
|
80
|
+
|
|
81
|
+
- name: Configure Git
|
|
82
|
+
run: |
|
|
83
|
+
git config user.name "github-actions[bot]"
|
|
84
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
85
|
+
|
|
86
|
+
- name: Deploy to GitHub Pages
|
|
87
|
+
run: uv run mkdocs gh-deploy --force
|
|
88
|
+
|
|
89
|
+
validate-links:
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/checkout@v5
|
|
93
|
+
|
|
94
|
+
- name: Set up Python
|
|
95
|
+
uses: actions/setup-python@v6
|
|
96
|
+
with:
|
|
97
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
98
|
+
|
|
99
|
+
- name: Install uv
|
|
100
|
+
uses: astral-sh/setup-uv@v7
|
|
101
|
+
with:
|
|
102
|
+
version: ${{ env.UV_VERSION }}
|
|
103
|
+
python-version: ${{ env.PYTHON_VERSION }}
|
|
104
|
+
|
|
105
|
+
- name: Install dependencies
|
|
106
|
+
run: |
|
|
107
|
+
uv sync --frozen
|
|
108
|
+
|
|
109
|
+
- name: Build and check links
|
|
110
|
+
run: |
|
|
111
|
+
uv run mkdocs build
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
|
|
8
|
+
# Distribution / packaging
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
pip-wheel-metadata/
|
|
22
|
+
share/python-wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Virtual Environments
|
|
29
|
+
.env
|
|
30
|
+
.venv
|
|
31
|
+
env/
|
|
32
|
+
venv/
|
|
33
|
+
ENV/
|
|
34
|
+
env.bak/
|
|
35
|
+
venv.bak/
|
|
36
|
+
.python-version
|
|
37
|
+
|
|
38
|
+
# IDEs
|
|
39
|
+
.vscode/
|
|
40
|
+
.idea/
|
|
41
|
+
*.swp
|
|
42
|
+
*.swo
|
|
43
|
+
*~
|
|
44
|
+
.DS_Store
|
|
45
|
+
|
|
46
|
+
# Testing
|
|
47
|
+
.pytest_cache/
|
|
48
|
+
.coverage
|
|
49
|
+
.coverage.*
|
|
50
|
+
htmlcov/
|
|
51
|
+
.tox/
|
|
52
|
+
.nox/
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
.hypothesis/
|
|
56
|
+
junit.xml
|
|
57
|
+
|
|
58
|
+
# Type checking
|
|
59
|
+
.mypy_cache/
|
|
60
|
+
.dmypy.json
|
|
61
|
+
dmypy.json
|
|
62
|
+
.pytype/
|
|
63
|
+
pyrightconfig.json
|
|
64
|
+
|
|
65
|
+
# Ruff
|
|
66
|
+
.ruff_cache/
|
|
67
|
+
|
|
68
|
+
# Jupyter Notebook
|
|
69
|
+
.ipynb_checkpoints
|
|
70
|
+
*.ipynb
|
|
71
|
+
|
|
72
|
+
# Documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
site/
|
|
75
|
+
|
|
76
|
+
# Build artifacts
|
|
77
|
+
*.prof
|
|
78
|
+
*.lprof
|
|
79
|
+
|
|
80
|
+
# OS
|
|
81
|
+
.DS_Store
|
|
82
|
+
Thumbs.db
|
|
83
|
+
.Spotlight-V100
|
|
84
|
+
.Trashes
|
|
85
|
+
|
|
86
|
+
# Temporary files
|
|
87
|
+
*.tmp
|
|
88
|
+
*.bak
|
|
89
|
+
*.log
|
|
90
|
+
.cache/
|
|
91
|
+
|
|
92
|
+
# Local storage
|
|
93
|
+
.notes/
|
|
94
|
+
.claude/settings.local.json
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#file: noinspection SpellCheckingInspection
|
|
2
|
+
# Pre-commit hooks for lifx-async
|
|
3
|
+
# Install: pre-commit install
|
|
4
|
+
# Run manually: pre-commit run --all-files
|
|
5
|
+
# Update hooks: pre-commit autoupdate
|
|
6
|
+
|
|
7
|
+
repos:
|
|
8
|
+
# General file checks
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v5.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
args: [--markdown-linebreak-ext=md]
|
|
14
|
+
- id: end-of-file-fixer
|
|
15
|
+
- id: check-yaml
|
|
16
|
+
args: [--unsafe]
|
|
17
|
+
- id: check-toml
|
|
18
|
+
- id: check-json
|
|
19
|
+
- id: check-added-large-files
|
|
20
|
+
args: [--maxkb=1000]
|
|
21
|
+
- id: check-case-conflict
|
|
22
|
+
- id: check-merge-conflict
|
|
23
|
+
- id: detect-private-key
|
|
24
|
+
- id: mixed-line-ending
|
|
25
|
+
args: [--fix=lf]
|
|
26
|
+
- id: check-docstring-first
|
|
27
|
+
- id: debug-statements
|
|
28
|
+
- id: name-tests-test
|
|
29
|
+
args: [--pytest-test-first]
|
|
30
|
+
|
|
31
|
+
# Conventional commit message with commitizen
|
|
32
|
+
- repo: https://github.com/commitizen-tools/commitizen
|
|
33
|
+
rev: v4.9.1
|
|
34
|
+
hooks:
|
|
35
|
+
- id: commitizen
|
|
36
|
+
- id: commitizen-branch
|
|
37
|
+
stages: [pre-push]
|
|
38
|
+
|
|
39
|
+
# Python dependency management with uv
|
|
40
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
41
|
+
rev: 0.9.5
|
|
42
|
+
hooks:
|
|
43
|
+
- id: uv-lock
|
|
44
|
+
|
|
45
|
+
# Python formatting with Ruff
|
|
46
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
47
|
+
rev: v0.9.1
|
|
48
|
+
hooks:
|
|
49
|
+
# Run the formatter
|
|
50
|
+
- id: ruff-format
|
|
51
|
+
types_or: [python, pyi]
|
|
52
|
+
|
|
53
|
+
# Run the linter
|
|
54
|
+
- id: ruff
|
|
55
|
+
types_or: [python, pyi]
|
|
56
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
57
|
+
|
|
58
|
+
# Type checking with Pyright
|
|
59
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
|
60
|
+
rev: v1.1.407
|
|
61
|
+
hooks:
|
|
62
|
+
- id: pyright
|
|
63
|
+
stages: [manual] # Only run when explicitly called
|
|
64
|
+
|
|
65
|
+
# Security checks
|
|
66
|
+
- repo: https://github.com/PyCQA/bandit
|
|
67
|
+
rev: 1.8.0
|
|
68
|
+
hooks:
|
|
69
|
+
- id: bandit
|
|
70
|
+
args: [-c, pyproject.toml]
|
|
71
|
+
additional_dependencies: ['bandit[toml]']
|
|
72
|
+
exclude: ^tests/
|
|
73
|
+
|
|
74
|
+
# Spell checking
|
|
75
|
+
- repo: https://github.com/codespell-project/codespell
|
|
76
|
+
rev: v2.3.0
|
|
77
|
+
hooks:
|
|
78
|
+
- id: codespell
|
|
79
|
+
args:
|
|
80
|
+
- --ignore-words-list=ommit,ser,nd,hass
|
|
81
|
+
- --skip="*.json,*.csv,*.xml"
|
|
82
|
+
|
|
83
|
+
# YAML formatting
|
|
84
|
+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
|
85
|
+
rev: v2.14.0
|
|
86
|
+
hooks:
|
|
87
|
+
- id: pretty-format-yaml
|
|
88
|
+
args: [--autofix, --indent, '2']
|
|
89
|
+
|
|
90
|
+
# Configuration for specific hooks
|
|
91
|
+
ci:
|
|
92
|
+
autofix_commit_msg: |
|
|
93
|
+
[pre-commit.ci] auto fixes from pre-commit hooks
|
|
94
|
+
|
|
95
|
+
for more information, see https://pre-commit.ci
|
|
96
|
+
autofix_prs: true
|
|
97
|
+
autoupdate_branch: ''
|
|
98
|
+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
|
|
99
|
+
autoupdate_schedule: weekly
|
|
100
|
+
skip: [pyright, run-tests] # Skip expensive hooks in CI
|
|
101
|
+
submodules: false
|