Skip to content

Commit

Permalink
feat: add pre-commit prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
seyLu committed Oct 23, 2023
1 parent 2fc4fdc commit 3f7f492
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
21 changes: 4 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,19 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
[*.{py}]
charset = utf-8

# 2 space indentation
[*.json, *.html]
[*.{yaml,yml,toml}]
indent_style = space
indent_size = 2

# 4 space indentation
[*.py]
[*.{py,md}]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
types_or: [yaml, toml, markdown]
additional_dependencies:
- prettier@3.0.3
- prettier-plugin-toml@1.0.0

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion src/ghlabel/utils/setup_github_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _fetch_github_labels(self, github_config: GithubConfig) -> list[dict[str, st

if res.status_code != 200:
logging.error(
f"Status {res.status_code}. Failed to fetch list of github labels. Supplied token might not have permission to access `{github_config.REPO_OWNER}/{github_config.REPO_NAME}`."
f"Status {res.status_code}. Failed to fetch list of github labels. Check if token has permission to access `{github_config.REPO_OWNER}/{github_config.REPO_NAME}`."
)
sys.exit()

Expand Down

0 comments on commit 3f7f492

Please sign in to comment.