Skip to content

feat: add configuration files for project setup with Poetry and pre-c… #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[settings]
# skip_glob=.mypy_cache
# skip_glob=.venv
# skip_glob=.git
# skip=.git, .mypy_cache, .venv
profile=black
skip_gitignore=True
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
fail_fast: false
repos:
- repo: local
hooks:
- id: system
name: Black
entry: black .
pass_filenames: false
language: system

- repo: local
hooks:
- id: system
name: ruff
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruff跟isort是不是功能有重叠,保留一个就行?

entry: ruff check .
args: [ --fix, --show-fixes ]
pass_filenames: false
language: system

- repo: local
hooks:
- id: system
name: isort
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个isort是需要把tushare那个库给ignore掉,因为默认导入tushare会有默认logging格式冲突的问题(reader那个目录)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻

entry: isort .
pass_filenames: false
language: system

- repo: local
hooks:
- id: system
name: pylint
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pylint这个会强制开发者执行么?毕竟fork的人比较多,让他们提交不了估计要炸毛

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有执行过 pre-commit install 的用户在 commit 后才会进行 pre-commit-config 中的检查,否则不会检查

entry: pylint -d W1203,W1309,C0114,W0718,C0116,C0115 app
pass_filenames: false
language: system

- repo: local
hooks:
- id: system
name: mypy
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那个xtquant文件夹是复制进来的第三方库,需要ignore掉

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻

entry: mypy --ignore-missing-imports app
pass_filenames: false
language: system
Loading