diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..4ce8a6e --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,26 @@ +name: Pre-commit Hooks + +on: + pull_request: {} + +jobs: + pre-commit: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d5ad78e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v3.0.0a5 + hooks: + - id: pylint + language: system diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..4e5bf4b --- /dev/null +++ b/.pylintrc @@ -0,0 +1,5 @@ +[MAIN] +errors-only=true + +# disable not callable (https://github.com/pylint-dev/pylint/issues/8138) +disable=E1102 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..40b0792 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn run:app diff --git a/README.md b/README.md index 60369b6..241e62c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ flask run This will start the development server with debug mode enabled and auto-reload on code changes. ### Production use -The recommended way is running with gunicorn (uncomment `gunicorn` in `requirements.txt`): +The recommended way is running with gunicorn ``` gunicorn run:app diff --git a/requirements.txt b/requirements.txt index e7e543e..988792c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,9 @@ Flask ~= 3.0 Flask-SQLAlchemy ~= 3.1 folium ~= 0.17 -# gunicorn ~= 23.0 +gunicorn ~= 23.0 ipaddress ~= 1.0 +pre-commit ~= 3.8 psycopg2-binary ~= 2.9 -requests ~= 2.32 \ No newline at end of file +pylint ~= 3.3 +requests ~= 2.32