Skip to content

Commit

Permalink
Added pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
danyi1212 committed Dec 1, 2023
1 parent 03f88a6 commit 4981ace
Show file tree
Hide file tree
Showing 43 changed files with 642 additions and 526 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/jsLinters/eslint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/poetry.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/ruff.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/build_Dockerfile.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/dev.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/generate_client.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/lint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/lint_fix.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/pytest_in_server.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/ruff_check.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/run_server.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^frontend/src/services/server
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-xml
- id: check-merge-conflict
- id: mixed-line-ending
args: [ --fix=lf ]

- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
hooks:
- id: poetry-check
files: pyproject.toml$
types: [ file ]
- id: poetry-lock
files: pyproject.toml$
types: [ file ]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
files: \.py$
types: [ file ]
- id: ruff-format
files: \.py$
types: [ file ]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.54.0
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [ file ]
21 changes: 11 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Thank you for your interest in contributing to Celery Insights! This document wi
## Reporting Bugs

> :warning: **WARNING**
>
> If you have discovered a security vulnerability, please **DO NOT** file a public issue.
>
> If you have discovered a security vulnerability, please **DO NOT** file a public issue.
> Instead, please report them directly to [email protected].
If you have found a bug, we would like to know, so we can fix it! Before you file a bug report, please make sure that
Expand Down Expand Up @@ -64,17 +64,18 @@ To contribute to the project, follow these steps:
```shell
poetry install
```
4. Navigate to the frontend folder.
```shell
cd frontend/
```
4. Install pre-commit hooks
```shell
pre-commit install
```
5. Install the Node.js dependencies using npm.
```shell
cd frontend/
npm install
```
```
6. Create `.env` file
```shell
cd server/
cd ../server/
cp .env.example .env
### Run dev server
Expand Down Expand Up @@ -118,10 +119,10 @@ To contribute to the project, follow these steps:
// Dont
const [lengthBad, setLength] = useState(items.length)
useEffect(() => setLength(items.length), [items])
// Do
const lengthGood = useMemo(() => items.length, [items])
}
}
```
- Avoid unnecessary React re-renders. Performance is important.
- Follow the existing folder structure.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Welcome to Celery Insights, the ultimate monitoring tool for your Celery cluster!

With Celery Insights, you can effortlessly track your Celery cluster in real-time.
Our modern web interface enables you to conveniently view worker status,
With Celery Insights, you can effortlessly track your Celery cluster in real-time.
Our modern web interface enables you to conveniently view worker status,
task information, and workflow graphs, all updated using websockets.

Inspired by Celery Flower, this tool takes Celery monitoring to the next level.
Inspired by Celery Flower, this tool takes Celery monitoring to the next level.
Try Celery Insights and transform the way you monitor your Celery cluster!

<p align="center">
Expand Down Expand Up @@ -43,7 +43,7 @@ For any questions, suggestions, or feature requests, please join the conversatio

> :warning: **WARNING**
>
> If you have discovered a security vulnerability, please **DO NOT** file a public issue.
> If you have discovered a security vulnerability, please **DO NOT** file a public issue.
> Instead, please report them directly to [email protected].
## Contributing
Expand Down
2 changes: 1 addition & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"no-console": ["warn", {"allow": ["warn", "error"]}],
"prettier/prettier": "warn"
}
}
}
Loading

0 comments on commit 4981ace

Please sign in to comment.