Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pre-commit #1860

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ jobs:
path: ${{ env.VIRTUAL_ENV }}
key: >-
${{ runner.os }}-${{ matrix.python }}-venv-${{
hashFiles('pyproject.toml') }}-${{
hashFiles('.pre-commit-config.yaml') }}
hashFiles('pyproject.toml') }}

- name: Create venv (NEW CACHE)
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -96,10 +95,10 @@ jobs:
run: |
mypy pymodbus

- name: precommit
- name: ruff
if: matrix.run_lint == true
run: |
pre-commit run --all-files
ruff .

- name: pytest
run: |
Expand Down
22 changes: 0 additions & 22 deletions .pre-commit-config.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,26 @@ or the bleeding edge::

git checkout dev

Some distributions have an old pip, which needs to be upgraded:

pip install --upgrade pip

Install required development tools::

pip install ".[development]"
pre-commit install

Install all (allows creation of documentation etc):

pip install ".[all]"
pre-commit install

Install git hooks, that helps control the commit and avoid errors when submitting a Pull Request:

cp githooks/* .git/hooks

This installs dependencies in your virtual environment
with pointers directly to the pymodbus directory,
so any change you make is immediately available as if installed.

It will also install :code:`pre-commit` git hooks, ensuring your commit are verified.

The repository contains a number of important branches and tags.
* **dev** is where all development happens, this branch is not always stable.
* **master** is where are releases are kept.
Expand Down
2 changes: 1 addition & 1 deletion check_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT


codespell
pre-commit run --all-files
ruff check --fix --exit-non-zero-on-fix .
pylint --recursive=y examples pymodbus test
mypy pymodbus
pytest --numprocesses auto
Expand Down
6 changes: 6 additions & 0 deletions githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# Redirect output to stderr.
exec 1>&2

exec ruff check --fix --exit-non-zero-on-fix .
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ development = [
"codespell>=2.2.2",
"coverage>=7.1.0",
"mypy>=1.6.0",
"pre-commit>=3.5.0",
"pylint>=2.17.2",
"pytest>=7.3.1",
"pytest-asyncio>=0.20.3",
Expand Down