Skip to content

Commit

Permalink
Brought back toml-sort to pre-commit (run-llama#8267)
Browse files Browse the repository at this point in the history
* Brought back toml-sort to pre-commit

* Ran pre-commit on all files for toml-sort

* Adds show diff on failure to pre-commit in make lint
  • Loading branch information
jamesbraza authored Oct 25, 2023
1 parent 72edf30 commit 8cff333
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ repos:
hooks:
- id: nb-clean
args: [--preserve-cell-outputs, --remove-empty-cells]
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
exclude: poetry.lock
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ format: ## Run code autoformatters (black).
pre-commit run black-jupyter --all-files

lint: ## Run linters: pre-commit (black, ruff, codespell) and mypy
pre-commit install && pre-commit run --all-files
pre-commit install && pre-commit run --all-files --show-diff-on-failure
mypy .

test: ## Run tests via pytest.
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tiktoken = ">=0.3.3"
typing-extensions = ">=4.5.0"
typing-inspect = ">=0.8.0"
urllib3 = "<2"
asyncpg = {version = "^0.28.0", optional = true}
asyncpg = {optional = true, version = "^0.28.0"}
pgvector = {optional = true, version = "^0.1.0"}
psycopg-binary = {optional = true, version = "^3.1.12"}
optimum = {extras = ["onnxruntime"], optional = true, version = "^1.13.2"}
Expand Down Expand Up @@ -88,13 +88,13 @@ query_tools = [
"spacy",
]


[tool.poetry.group.dev.dependencies]
beautifulsoup4 = "^4.12.2" # needed for tests
black = {extras = ["jupyter"], version = "<=23.9.1,>=23.7.0"}
codespell = {extras = ["toml"], version = ">=v2.2.6"}
google-generativeai = {python = ">=3.9,<3.12", version = "^0.2.1"}
ipython = "8.10.0"
jupyter = "^1.0.0"
mypy = "0.991"
pre-commit = "3.2.0"
pylint = "2.15.10"
Expand All @@ -111,7 +111,6 @@ types-redis = "4.5.5.0"
types-requests = "2.28.11.8"
types-setuptools = "67.1.0.0"
vellum-ai = "^0.0.42"
jupyter = "^1.0.0"

[tool.poetry.group.docs]
optional = true
Expand Down Expand Up @@ -232,3 +231,6 @@ in_place = true
spaces_before_inline_comment = 2 # Match Python PEP 8
spaces_indent_inline_array = 4 # Match Python PEP 8
trailing_comma_inline_array = true

[tool.tomlsort.overrides."tool.poetry.dependencies"]
table_keys = false

0 comments on commit 8cff333

Please sign in to comment.