Skip to content

Commit

Permalink
Remove pre-commit (#1860)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Ruddick <a.ruddick@numat-tech.com>
  • Loading branch information
janiversen and alexrudd2 committed Oct 27, 2023
1 parent 0108921 commit 5e9a3ca
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 32 deletions.
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.
1>&2

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

0 comments on commit 5e9a3ca

Please sign in to comment.