Skip to content

Commit

Permalink
Configure pre commit hooks in CI (#106)
Browse files Browse the repository at this point in the history
* Add pre-commit ci hooks

* Resolve double quotes string linting issue
  • Loading branch information
mohamedawnallah authored Dec 28, 2023
1 parent 7da908f commit 76ea12e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 36 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/format-and-lint.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pre-commit CI

on: [push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: pip install -r requirements.txt

# This will configure the pre-commit hooks in
# '.pre-commit-config.yaml' file.
- name: Configure pre-commit
run: pre-commit install

- name: Run pre-commit hooks
run: pre-commit run --all-files
6 changes: 3 additions & 3 deletions create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def __init__(self, message):
crawler.close()
if not relations_count_new > relations_count:
error_message = (
f"Unexpected relation count change in the crawler '{name}': "
f"Expected new relations ({relations_count_new}) "
f"to be greater than the previous relations ({relations_count})."
f'Unexpected relation count change in the crawler "{name}": '
f'Expected new relations ({relations_count_new}) '
f'to be greater than the previous relations ({relations_count}).'
)
raise RelationCountError(error_message)
status[module_name] = 'OK'
Expand Down

0 comments on commit 76ea12e

Please sign in to comment.