@@ -148,7 +148,7 @@ dev = [
148148 " pillow >=11" ,
149149 " playwright >=1.51" ,
150150 " plotly >=6.0" ,
151- " pre-commit >=4.2" ,
151+ " pre-commit-pyproject-toml >=4.2.0.post2 " ,
152152 " psycopg[binary] >=3.2" ,
153153 " pyright >=1.1.400" ,
154154 " pytest >=8.3" ,
@@ -166,3 +166,53 @@ dev = [
166166 " starlette-admin >=0.14" ,
167167 " uvicorn >=0.34.0" ,
168168]
169+
170+ [tool .pre-commit ]
171+ fail_fast = true
172+
173+ [[tool .pre-commit .repos ]]
174+ repo = " https://github.com/astral-sh/ruff-pre-commit"
175+ rev = " v0.11.7"
176+ hooks = [
177+ { id = " ruff-format" , args = [
178+ " reflex" ,
179+ " tests" ,
180+ ] },
181+ { id = " ruff" , args = [
182+ " --fix" ,
183+ " --exit-non-zero-on-fix" ,
184+ ], exclude = " ^integration/benchmarks/" },
185+ ]
186+
187+ [[tool .pre-commit .repos ]]
188+ repo = " https://github.com/codespell-project/codespell"
189+ rev = " v2.4.1"
190+ hooks = [
191+ { id = " codespell" , args = [
192+ " reflex" ,
193+ ], additional_dependencies = [
194+ " tomli" ,
195+ ] },
196+ ]
197+
198+ # Run pyi check before pyright because pyright can fail if pyi files are wrong.
199+ [[tool .pre-commit .repos ]]
200+ repo = " local"
201+ hooks = [
202+ { id = " update-pyi-files" , name = " update-pyi-files" , always_run = true , language = " system" , require_serial = true , description = " Update pyi files as needed" , entry = " python3 scripts/make_pyi.py" },
203+ ]
204+
205+ [[tool .pre-commit .repos ]]
206+ repo = " https://github.com/RobertCraigie/pyright-python"
207+ rev = " v1.1.400"
208+ hooks = [{ id = " pyright" , args = [" reflex" , " tests" ], language = " system" }]
209+
210+ [[tool .pre-commit .repos ]]
211+ repo = " https://github.com/terrencepreilly/darglint"
212+ rev = " v1.8.1"
213+ hooks = [{ id = " darglint" , exclude = " ^reflex/reflex.py" }]
214+
215+ [[tool .pre-commit .repos ]]
216+ repo = " https://github.com/pre-commit/mirrors-prettier"
217+ rev = " f62a70a3a7114896b062de517d72829ea1c884b6"
218+ hooks = [{ id = " prettier" , require_serial = true }]
0 commit comments