mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
add ruff for code lint
This commit is contained in:
parent
34f437174d
commit
192c030281
2 changed files with 82 additions and 13 deletions
|
|
@ -1,20 +1,9 @@
|
|||
default_stages: [ commit ]
|
||||
|
||||
# Install
|
||||
# 1. pip install pre-commit
|
||||
# 2. pre-commit install(the first time you download the repo, it will be cached for future use)
|
||||
repos:
|
||||
- repo: https://github.com/pycqa/flake8
|
||||
rev: 4.0.1
|
||||
hooks:
|
||||
- id: flake8
|
||||
args: [
|
||||
"--show-source",
|
||||
"--count",
|
||||
"--statistics",
|
||||
"--extend-ignore=E203,E402,C901,E501,E101,E266,E731,W291,F821,W191,E122,E125,E127,E128,W293",
|
||||
"--per-file-ignores=__init__.py:F401",
|
||||
] # when necessary, ignore errors, https://flake8.pycqa.org/en/latest/user/error-codes.html
|
||||
exclude: ^venv/ # exclude dir, e.g. (^foo/|^bar/)
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.11.5
|
||||
hooks:
|
||||
|
|
@ -24,3 +13,14 @@ repos:
|
|||
(?x)^(
|
||||
.*__init__\.py$
|
||||
)
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# Ruff version.
|
||||
rev: v0.0.284
|
||||
hooks:
|
||||
- id: ruff
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
69
pyproject.toml
Normal file
69
pyproject.toml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
[project]
|
||||
name = "chatgit"
|
||||
version = "0.1.0"
|
||||
description = "chatgit is an LLM model-based open source project competition analysis research project, it can help you find the most suitable open source project for your needs"
|
||||
authors = [
|
||||
{name = "hezz", email = "hezhaozhaog@gmail.com"},
|
||||
]
|
||||
dependencies = [
|
||||
"requests>=2.31.0",
|
||||
]
|
||||
requires-python = ">=3.11"
|
||||
readme = "README.md"
|
||||
license = {text = "Apache"}
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=61", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.black]
|
||||
line-length = 119
|
||||
target-version = ['py39']
|
||||
|
||||
|
||||
[tool.ruff]
|
||||
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
||||
select = ["E", "F"]
|
||||
ignore = ["E501", "E712", "E722", "F821"]
|
||||
|
||||
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
||||
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
|
||||
unfixable = []
|
||||
|
||||
# Exclude a variety of commonly ignored directories.
|
||||
exclude = [
|
||||
".bzr",
|
||||
".direnv",
|
||||
".eggs",
|
||||
".git",
|
||||
".git-rewrite",
|
||||
".hg",
|
||||
".mypy_cache",
|
||||
".nox",
|
||||
".pants.d",
|
||||
".pytype",
|
||||
".ruff_cache",
|
||||
".svn",
|
||||
".tox",
|
||||
".venv",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"buck-out",
|
||||
"build",
|
||||
"dist",
|
||||
"node_modules",
|
||||
"venv",
|
||||
]
|
||||
|
||||
# Same as Black.
|
||||
line-length = 119
|
||||
|
||||
# Allow unused variables when underscore-prefixed.
|
||||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||
|
||||
# Assume Python 3.9
|
||||
target-version = "py39"
|
||||
|
||||
[tool.ruff.mccabe]
|
||||
# Unlike Flake8, default to a complexity level of 10.
|
||||
max-complexity = 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue