Skip to content

Commit

Permalink
Add pre-commit hook to run prettier re #10575
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Apr 26, 2024
1 parent 0cebc36 commit ce28593
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
repos:
- repo: local
hooks:
- id: prettier
name: prettier
entry: arches/app/media/node_modules/.bin/prettier
args: [arches/app/src, --write, --ignore-unknown]
language: system
2 changes: 1 addition & 1 deletion arches/install/arches-admin
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ArchesProjectCommand(TemplateCommand):
# need to manually replace instances of {{ project_name }} in some files
path_to_project = os.path.join(target) if target else os.path.join(os.getcwd(), project_name)

for relative_file_path in [".yarnrc", "pyproject.toml"]: # relative to app root directory
for relative_file_path in [".yarnrc", ".pre-commit-config.yaml", "pyproject.toml"]: # relative to app root directory
file = open(os.path.join(path_to_project, relative_file_path),'r')
file_data = file.read()
file.close()
Expand Down
2 changes: 1 addition & 1 deletion arches/install/arches-project
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ArchesCommand(TemplateCommand):
# need to manually replace instances of {{ project_name }} in some files
path_to_project = os.path.join(target) if target else os.path.join(os.getcwd(), project_name)

for relative_file_path in [".yarnrc", "pyproject.toml"]: # relative to app root directory
for relative_file_path in [".yarnrc", ".pre-commit-config.yaml", "pyproject.toml"]: # relative to app root directory
file = open(os.path.join(path_to_project, relative_file_path),'r')
file_data = file.read()
file.close()
Expand Down
8 changes: 8 additions & 0 deletions arches/install/arches-templates/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
repos:
- repo: local
hooks:
- id: prettier
name: prettier
entry: ./{{ project_name }}/media/node_modules/.bin/prettier ./{{ project_name }}/src --write
language: system
4 changes: 2 additions & 2 deletions arches/install/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
livereload
sst
coverage
sauceclient
django-silk==5.1.0
django-silk==5.1.0
pre-commit
5 changes: 5 additions & 0 deletions releases/7.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ Python:
openpyxl 3.0.7 > 3.0.10
Added:
(dev dependencies):
pre-commit
Removed:
django_compressor
mapbox-vector-tile
(dev dependencies):
sauceclient
JavaScript:
Upgraded:
vue == 3.4.21
Expand Down

0 comments on commit ce28593

Please sign in to comment.