Skip to content

Commit 41c621a

Browse files
authored
Merge pull request #44 from SundayWindy/feat/pre-commit
feat(pre-commit): add pre-commit
2 parents 414cea2 + 3480264 commit 41c621a

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/workflows/.precommit.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v3
17+
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install pre-commit flit && flit install --symlink
22+
23+
- name: Run pre-commit hooks
24+
run: pre-commit run --all-files

excelalchemy/core/alchemy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def _validate_header(self, input_excel_name: str) -> ValidateHeaderResult:
353353
unrecognized = list(set(input_labels) - set(x.label for x in self.ordered_field_meta))
354354

355355
missing_primary, missing_required = [], []
356-
if self.config == ImportMode.UPDATE:
356+
if self.config.import_mode == ImportMode.UPDATE:
357357
missing_primary = list(set(primary_labels) - set(input_labels))
358358

359359
missing_required = list(set(required_labels) - set(input_labels) - set(missing_primary))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ development = [
3232
"mypy",
3333
"pylint",
3434
"pre-commit",
35-
"pyright",
35+
"pyright==1.1.299",
3636
"pytest",
3737
"coverage",
3838
"pytest-cov",

0 commit comments

Comments
 (0)