mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 10:53:02 +01:00
Add, configure and run pre-commit locally and in test workflow
This commit is contained in:
parent
5e83baab21
commit
051f0e3fb5
22 changed files with 183 additions and 162 deletions
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
|
@ -9,6 +9,7 @@ on:
|
||||||
- tests/**
|
- tests/**
|
||||||
- config/**
|
- config/**
|
||||||
- pyproject.toml
|
- pyproject.toml
|
||||||
|
- .pre-commit-config.yml
|
||||||
- .github/workflows/test.yml
|
- .github/workflows/test.yml
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -18,6 +19,7 @@ on:
|
||||||
- tests/**
|
- tests/**
|
||||||
- config/**
|
- config/**
|
||||||
- pyproject.toml
|
- pyproject.toml
|
||||||
|
- .pre-commit-config.yml
|
||||||
- .github/workflows/test.yml
|
- .github/workflows/test.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -45,9 +47,10 @@ jobs:
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
|
|
||||||
- name: Install Application
|
- name: Install Application
|
||||||
run: |
|
run: pip install --upgrade .[dev]
|
||||||
pip install --upgrade .[dev]
|
|
||||||
|
- name: Validate Application
|
||||||
|
run: pre-commit
|
||||||
|
|
||||||
- name: Test Application
|
- name: Test Application
|
||||||
run: |
|
run: pytest
|
||||||
pytest
|
|
||||||
|
|
16
.pre-commit-config.yaml
Normal file
16
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 23.1.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.3.0
|
||||||
|
hooks:
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
# Exclude elisp files to not clear page breaks
|
||||||
|
exclude: \.el$
|
||||||
|
- id: check-json
|
||||||
|
- id: check-toml
|
||||||
|
- id: check-yaml
|
1
LICENSE
1
LICENSE
|
@ -619,4 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
|
||||||
copy of the Program in return for a fee.
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
|
@ -64,10 +64,14 @@ khoj = "khoj.main:run"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
test = [
|
test = [
|
||||||
"pytest >= 7.1.2",
|
"pytest >= 7.1.2",
|
||||||
"black >= 23.1.0",
|
]
|
||||||
|
dev = [
|
||||||
|
"khoj-assistant[test]",
|
||||||
|
"mypy >= 1.0.1",
|
||||||
|
"black >= 23.1.0",
|
||||||
|
"pre-commit >= 3.0.4",
|
||||||
]
|
]
|
||||||
dev = ["khoj-assistant[test]"]
|
|
||||||
|
|
||||||
[tool.hatch.build.targets.sdist]
|
[tool.hatch.build.targets.sdist]
|
||||||
include = ["src/khoj"]
|
include = ["src/khoj"]
|
||||||
|
@ -79,8 +83,8 @@ packages = ["src/khoj"]
|
||||||
files = "src/khoj"
|
files = "src/khoj"
|
||||||
pretty = true
|
pretty = true
|
||||||
strict_optional = false
|
strict_optional = false
|
||||||
ignore_missing_imports = true
|
|
||||||
install_types = true
|
install_types = true
|
||||||
|
ignore_missing_imports = true
|
||||||
non_interactive = true
|
non_interactive = true
|
||||||
show_error_codes = true
|
show_error_codes = true
|
||||||
warn_unused_ignores = true
|
warn_unused_ignores = true
|
||||||
|
|
|
@ -619,4 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
|
||||||
copy of the Program in return for a fee.
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue