mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 05:39:11 +00:00
Add, configure and run pre-commit locally and in test workflow
This commit is contained in:
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@@ -9,6 +9,7 @@ on:
|
||||
- tests/**
|
||||
- config/**
|
||||
- pyproject.toml
|
||||
- .pre-commit-config.yml
|
||||
- .github/workflows/test.yml
|
||||
push:
|
||||
branches:
|
||||
@@ -18,6 +19,7 @@ on:
|
||||
- tests/**
|
||||
- config/**
|
||||
- pyproject.toml
|
||||
- .pre-commit-config.yml
|
||||
- .github/workflows/test.yml
|
||||
|
||||
jobs:
|
||||
@@ -45,9 +47,10 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
- name: Install Application
|
||||
run: |
|
||||
pip install --upgrade .[dev]
|
||||
run: pip install --upgrade .[dev]
|
||||
|
||||
- name: Validate Application
|
||||
run: pre-commit
|
||||
|
||||
- name: Test Application
|
||||
run: |
|
||||
pytest
|
||||
run: 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.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
@@ -65,9 +65,13 @@ khoj = "khoj.main:run"
|
||||
[project.optional-dependencies]
|
||||
test = [
|
||||
"pytest >= 7.1.2",
|
||||
"black >= 23.1.0",
|
||||
]
|
||||
dev = ["khoj-assistant[test]"]
|
||||
dev = [
|
||||
"khoj-assistant[test]",
|
||||
"mypy >= 1.0.1",
|
||||
"black >= 23.1.0",
|
||||
"pre-commit >= 3.0.4",
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.sdist]
|
||||
include = ["src/khoj"]
|
||||
@@ -79,8 +83,8 @@ packages = ["src/khoj"]
|
||||
files = "src/khoj"
|
||||
pretty = true
|
||||
strict_optional = false
|
||||
ignore_missing_imports = true
|
||||
install_types = true
|
||||
ignore_missing_imports = true
|
||||
non_interactive = true
|
||||
show_error_codes = 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.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user