Skip to content

Commit

Permalink
feat: add utility script to run the ci pipeline locally
Browse files Browse the repository at this point in the history
  • Loading branch information
TendTo committed Nov 20, 2023
1 parent 59937a7 commit 40ff876
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ pip3 install -e .[lint]
- **Run** `black --check src tests` to make sure the code is formatted correctly. If it is not, you can run `black src` to format it automatically
- **Run** `isort --check-only src tests` to make sure the imports are sorted correctly. If they are not, you can run `isort src` to sort them automatically

### Scripts

The `scripts` folder contains some utility scripts that can be used to simulate the whole CI pipeline locally.
Make sure to have the dev dependencies installed before running them.

## 📚 Documentation

[Link to the documentation](https://unict-dmi.github.io/Telegram-SpottedDMI-Bot/)
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import shutil
import sys

sys.path.insert(0, os.path.abspath("../..")) # path to the actual project root folder

Expand Down
6 changes: 6 additions & 0 deletions script/local-ci.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
rem Run all the tests and linters in the CI pipeline locally
pytest tests
pylint src tests
black --check src tests
isort --check-only src tests
5 changes: 5 additions & 0 deletions script/local-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Run all the tests and linters in the CI pipeline locally
pytest tests || (echo "Tests failed" && exit 1)
pylint src tests || (echo "Pylint failed" && exit 1)
black --check src tests || (echo "Black failed" && exit 1)
isort --check-only src tests || (echo "Isort failed" && exit 1)
2 changes: 1 addition & 1 deletion src/spotted/data/user.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Users management"""
from dataclasses import dataclass
from random import choice
from datetime import datetime
from random import choice

from telegram import Bot

Expand Down

0 comments on commit 40ff876

Please sign in to comment.