Skip to content

Commit c504748

Browse files
Merge pull request #26 from LLMSQL/12-configure-precommit-hooks
pre commit config added; CONTRIBUTING.md updated
2 parents 3f57cf7 + 5dac030 commit c504748

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+272
-199
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @DzmitryPihulski
1+
* @DzmitryPihulski

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4
20-
20+
2121
- name: Setup Pages
2222
uses: actions/configure-pages@v4
23-
23+
2424
- name: Upload artifact
2525
uses: actions/upload-pages-artifact@v3
2626
with:
2727
path: ./docs/_build
28-
28+
2929
- name: Deploy to GitHub Pages
3030
id: deployment
31-
uses: actions/deploy-pages@v4
31+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ jobs:
9595
- name: Publish distribution to TestPyPI
9696
uses: pypa/gh-action-pypi-publish@release/v1
9797
with:
98-
repository-url: https://test.pypi.org/legacy/
98+
repository-url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dist/
66

77
*.egg-info/
88
.pdm-python
9-
.vscode
9+
.vscode

.pre-commit-config.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Pre-commit hooks configuration
2+
# Setup: pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
5+
repos:
6+
# Ruff
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.8.4
9+
hooks:
10+
# Run the linter
11+
- id: ruff
12+
args: [--fix]
13+
types_or: [python, pyi]
14+
# Run the formatter
15+
- id: ruff-format
16+
types_or: [python, pyi]
17+
18+
# Mypy
19+
- repo: https://github.com/pre-commit/mirrors-mypy
20+
rev: v1.13.0
21+
hooks:
22+
- id: mypy
23+
args: [--ignore-missing-imports, --check-untyped-defs]
24+
files: ^llmsql/
25+
additional_dependencies:
26+
- types-PyYAML
27+
- types-tqdm
28+
- types-requests
29+
30+
# Run tests with pytest
31+
- repo: local
32+
hooks:
33+
- id: pytest
34+
name: pytest
35+
entry: pytest
36+
language: system
37+
pass_filenames: false
38+
always_run: true
39+
args:
40+
- tests/
41+
- -v
42+
- --tb=short
43+
stages: [pre-commit]
44+
45+
# Standard pre-commit hooks
46+
- repo: https://github.com/pre-commit/pre-commit-hooks
47+
rev: v5.0.0
48+
hooks:
49+
# Check for files that would conflict in case-insensitive filesystems
50+
- id: check-case-conflict
51+
# Check for merge conflicts
52+
- id: check-merge-conflict
53+
# Check YAML syntax
54+
- id: check-yaml
55+
# Check TOML syntax
56+
- id: check-toml
57+
# Check for added large files
58+
- id: check-added-large-files
59+
args: [--maxkb=1000]
60+
# Trim trailing whitespace
61+
- id: trailing-whitespace
62+
# Ensure files end with newline
63+
- id: end-of-file-fixer
64+
# Check JSON syntax
65+
- id: check-json
66+
# Check for debugger imports
67+
- id: debug-statements
68+
69+
# Configuration for specific hooks
70+
default_language_version:
71+
python: python3.11
72+
73+
# Run these hooks on every commit
74+
default_stages: [pre-commit]

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pip3 install --user pdm
2828
git clone https://github.com/<YOUR_USERNAME>/llmsql-benchmark.git
2929
cd llmsql-benchmark
3030
pdm install --without default --with dev
31+
pre-commit install
3132
```
3233

3334
> **Note**: If you see `Command 'pdm' not found`, it usually means `~/.local/bin` is not on your `PATH`.
@@ -55,6 +56,7 @@ PYTHONPATH=. pdm run pytest --cov=llmsql --cov-report=xml --maxfail=1 --disable-
5556

5657
Please run this command before any changes, just to make sure all code you forked works well by the time the development starts.
5758

59+
Also to enable `pre-commit hooks` with `pre-commit install` command. Pre commit hooks contain pytest and will be run before each commit.
5860

5961
## Contribution Best Practices
6062

@@ -90,4 +92,4 @@ There are a number of distinct ways to contribute to LLMSQL, and all are extreme
9092
- **Testing and devops** - We are very grateful for any assistance in adding tests for the library that can be run for new PRs, and other devops workflows.
9193
- **Proposing or Contributing New Features** - We want LLMSQL to be the best way to interact (evaluate) models on our benchmark. If you have a feature that is not currently supported but desired, feel free to open an issue describing the feature and, if applicable, how you intend to implement it. We would be happy to give feedback on the cleanest way to implement new functionalities and are happy to coordinate with interested contributors.
9294
93-
We hope that this has been helpful, and appreciate your interest in contributing!
95+
We hope that this has been helpful, and appreciate your interest in contributing!

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
44

55
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Our datasets are available for different scenarios on our [HuggingFace page](htt
2121
pip3 install llmsql
2222
```
2323

24-
This repository provides the **LLMSQL Benchmark** — a modernized, cleaned, and extended version of WikiSQL, designed for evaluating and fine-tuning large language models (LLMs) on **Text-to-SQL** tasks.
24+
This repository provides the **LLMSQL Benchmark** — a modernized, cleaned, and extended version of WikiSQL, designed for evaluating and fine-tuning large language models (LLMs) on **Text-to-SQL** tasks.
2525

2626
### Note
2727
The package doesn't have the dataset, it is stored on our [HuggingFace page](https://huggingface.co/llmsql-bench).
@@ -36,7 +36,7 @@ The package doesn't have the dataset, it is stored on our [HuggingFace page](htt
3636

3737
## Usage Recommendations
3838

39-
Modern LLMs are already strong at **producing SQL queries without finetuning**.
39+
Modern LLMs are already strong at **producing SQL queries without finetuning**.
4040
We therefore recommend that most users:
4141

4242
1. **Run inference** directly on the full benchmark:
@@ -151,5 +151,3 @@ Please cite LLMSQL if you use it in your work:
151151
organization={IEEE}
152152
}
153153
```
154-
155-

docs/_build/_sources/index.rst.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ LLMSQL is a Python package for SQL reasoning with LLMs and vLLM inference.
3434
.. toctree::
3535
:maxdepth: 2
3636
:caption: Contents:
37-

docs/_build/_static/basic.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,4 +903,4 @@ div.math:hover a.headerlink {
903903
#top-link {
904904
display: none;
905905
}
906-
}
906+
}

0 commit comments

Comments
 (0)