Skip to content

Commit

Permalink
replace last peaces of isort, pylint, black, flake
Browse files Browse the repository at this point in the history
  • Loading branch information
orgua committed Dec 11, 2023
1 parent 00e1a9d commit 76ef5f5
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 33 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/qa_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
sudo apt install python3-msgpack
sudo apt install cppcheck
python3 -m pip install --upgrade pip msgpack
pip3 install pylint pylint-exit pylint-pytest
pip3 install ansible -U
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
Expand All @@ -44,10 +43,6 @@ jobs:
run: "sudo pytest"
working-directory: "./software/python-package"
# needs sudo because it installs packages
- name: PyLint the shepherd py-package 🐏
run: "pylint $(git ls-files '*.py') || pylint-exit $?"
# -E --py-version 3.10
working-directory: "software/python-package/"

- name: Install the shepherd-herd py-package 𓋿 𓀍
run: "sudo pip3 install ./"
Expand Down
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ repos:
# - id: mypy
# TODO: activate mypy -> some work to fix type-annotations
# TODO: github.com/PyCQA/pydocstyle
# TODO: github.com/PyCQA/pylint

# - repo: https://github.com/RobertCraigie/pyright-python
# rev: v1.1.298
Expand All @@ -120,11 +119,5 @@ repos:
# - shepherd-herd
# - shepherd-sheep

# - repo: https://github.com/charliermarsh/ruff-pre-commit
# rev: v0.0.257
# hooks:
# - id: ruff
# args: ["--fix", "--exit-non-zero-on-fix"]

# default_language_version:
# python: python3.10
3 changes: 1 addition & 2 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@ force-single-line = true
[lint.pyupgrade]
keep-runtime-typing = true

[format]
# per default like Black
[format] # per default like Black
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Build Pru](https://github.com/orgua/shepherd/actions/workflows/build_pru_gcc.yml/badge.svg)](https://github.com/orgua/shepherd/actions/workflows/build_pru_gcc.yml)
[![Code Quality](https://www.codefactor.io/repository/github/orgua/shepherd/badge)](https://www.codefactor.io/repository/github/orgua/shepherd)
[![PyPiVersion](https://img.shields.io/pypi/v/shepherd_herd.svg)](https://pypi.org/project/shepherd_herd)
[![CodeStyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

**Documentation**: <https://orgua.github.io/shepherd/>

Expand Down
6 changes: 4 additions & 2 deletions docs/dev/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Codestyle

Please stick to the C and Python codestyle guidelines provided with the source code.

All included **Python code** uses the feature-set of **version 3.10** is supposed to be formatted using `Black <https://black.readthedocs.io/en/stable/>`_ in default mode and is tested with the `Flake8 <https://flake8.pycqa.org/en/latest/>`_ linter including some addons for cleaner and more secure code.
All included **Python code** uses the feature-set of **version 3.10** is supposed to be formatted & linted using `ruff <https://docs.astral.sh/ruff/>`_ for cleaner and more secure code.

**C code** uses the feature-set of **C99** and shall be formatted based on *LLVM*-Style with some alterations to make it easier to read, similar to python code.
We provide the corresponding ``clang-format`` config as ``.clang-format`` in the repository's root directory.
Expand Down Expand Up @@ -146,7 +146,9 @@ Once you have a clean, stable and tested version of code, you should decide if y
Use ``bump2version`` to update the version number across the repository:

.. code-block:: bash
pipenv shell
pre-commit run --all-files
bump2version patch --allow-dirty
bump2version patch
Finally, open a pull-request to allow merging your changes into the main-branch and to trigger the test-pipeline.
2 changes: 1 addition & 1 deletion docs/external/shepherd_core.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PyPiVersion](https://img.shields.io/pypi/v/shepherd_core.svg)](https://pypi.org/project/shepherd_core)
[![Pytest](https://github.com/orgua/shepherd-datalib/actions/workflows/python-app.yml/badge.svg)](https://github.com/orgua/shepherd-datalib/actions/workflows/python-app.yml)
[![CodeStyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

**Documentation**: <https://orgua.github.io/shepherd/external/shepherd_core.html>

Expand Down
2 changes: 1 addition & 1 deletion docs/external/shepherd_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PyPiVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
[![Pytest](https://github.com/orgua/shepherd-datalib/actions/workflows/python-app.yml/badge.svg)](https://github.com/orgua/shepherd-datalib/actions/workflows/python-app.yml)
[![CodeStyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

**Documentation**: <https://orgua.github.io/shepherd/external/shepherd_data.html>

Expand Down
3 changes: 0 additions & 3 deletions software/python-package/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ install_requires =

[options.extras_require]
dev =
black
pylint
flake8
twine
pre-commit
pyright
Expand Down
2 changes: 1 addition & 1 deletion software/python-package/shepherd_sheep/eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, bus_num: int = 2, address: int = 0x54, wp_pin: int = 49) -> N
address (int): Address of EEPROM, usually fixed in hardware or
by DIP switch
"""
self.dev_path = f"/sys/bus/i2c/devices/{bus_num}" f"-{address:04X}/eeprom"
self.dev_path = f"/sys/bus/i2c/devices/{bus_num}-{address:04X}/eeprom"
self._write_protect_pin: GPIO = GPIO(wp_pin, "out")
self._write_protect_pin.write(True)

Expand Down
3 changes: 0 additions & 3 deletions software/shepherd-calibration/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ install_requires =

[options.extras_require]
dev =
black
pylint
flake8
twine
pre-commit
pyright
Expand Down
2 changes: 1 addition & 1 deletion software/shepherd-herd/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Shepherd-Herd

[![PyPiVersion](https://img.shields.io/pypi/v/shepherd_herd.svg)](https://pypi.org/project/shepherd_herd)
[![CodeStyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

*Shepherd-herd* is the command line utility for controlling a group of shepherd nodes remotely through an IP-based network.

Expand Down
3 changes: 0 additions & 3 deletions software/shepherd-herd/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ install_requires =

[options.extras_require]
dev =
black
pylint
flake8
twine
pre-commit
pyright
Expand Down
3 changes: 0 additions & 3 deletions software/test_timesync/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ install_requires =

[options.extras_require]
dev =
black
pylint
flake8
twine
pre-commit
pyright
Expand Down

0 comments on commit 76ef5f5

Please sign in to comment.