Skip to content

Commit

Permalink
Merge pull request #41 from orgua/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
orgua authored Feb 18, 2024
2 parents c55ef95 + 9eb5bce commit 291ae5f
Show file tree
Hide file tree
Showing 577 changed files with 1,183,400 additions and 3,951 deletions.
6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[bumpversion]
current_version = 0.7.1
current_version = 0.7.2
commit = False
tag = False

# example: bump2version patch --allow-dirty

[bumpversion:file:software/kernel-module/src/module_base.c]

[bumpversion:file:software/python-package/shepherd_sheep/__init__.py]
Expand All @@ -14,3 +12,5 @@ tag = False
[bumpversion:file:software/shepherd-calibration/shepherd_cal/__init__.py]

[bumpversion:file:software/pps-gmtimer/src/pps-gmtimer.c]

[bumpversion:file:software/test_timesync/sync_analysis/__init__.py]
12 changes: 12 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[codespell]

builtin = clear,rare,informal,usage,code,en-GB_to_en-US

skip = hardware/_deprecated/*,*.svg,*/sphinx_to_pages.yml,*/nrf52840.h,*/nrf52840_bitfields.h,*/core_cm4.h
# TODO: sphinx-entry only included temporarily
# TODO: programmer header-files contain external code
ignore-words-list = dout,jupyter,stdio,astroid,uint,fram,arange,ro

# options without argument
check-filenames =
check-hidden =
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug report
description: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

If possible choose the correct project:

- [main-repo](https://github.com/orgua/shepherd/issues)
- [datalib](https://github.com/orgua/shepherd-datalib/issues)
- [targets](https://github.com/orgua/shepherd-targets/issues)
- [webapi](https://github.com/orgua/shepherd_webservice/issues)

## Description

A clear and concise description of what the bug is.

## How to reproduce

Steps to reproduce the behavior.

1. Go to '...'
2. Type '....'
3. Scroll down to '....'
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots & Error Logs

If applicable, add screenshots to help explain your problem.

## Environment

Give some information about your setup.

## Additional Context

Add any other context about the problem here.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Feature request
description: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''

---

If possible choose the correct project:

- [main-repo](https://github.com/orgua/shepherd/issues)
- [datalib](https://github.com/orgua/shepherd-datalib/issues)
- [targets](https://github.com/orgua/shepherd-targets/issues)
- [webapi](https://github.com/orgua/shepherd_webservice/issues)


**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix:
# Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix:
6 changes: 6 additions & 0 deletions .github/workflows/build_pru_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ jobs:
make PROTO=SBW
${{ env.PRU_GCC }}/bin/pru-size gen_gcc/pru0-programmer-SBW-fw.elf
working-directory: "software/firmware/pru0-programmer/"

- name: Build Sync (GPIO-Event) 🧱
run: |
make
${{ env.PRU_GCC }}/bin/pru-size gen_gcc/pru1-sync-fw.elf
working-directory: "software/firmware/pru1-sync/"
8 changes: 4 additions & 4 deletions .github/workflows/publish_herd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ permissions:
contents: read

jobs:
run-quality-assurance:
uses: ./.github/workflows/qa_tests.yml
run-quality-control:
uses: ./.github/workflows/qc_tests.yml
deploy:

runs-on: ubuntu-latest
needs:
- run-quality-assurance
- run-quality-control
env:
herd_path: "./software/shepherd-herd"

Expand All @@ -32,7 +32,7 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Python 🐍
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies 🔧
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test for Quality Assurance
name: Test for Quality Control

on:
push:
Expand All @@ -9,15 +9,15 @@ on:

jobs:
tests:
runs-on: ubuntu-22.04 # TODO: -latest was 20.04 and had old packages
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10"]
python-version: ["3.12", "3.11", "3.10"] # TODO: reactivate "3.12", failing ATM (2023-11-06)
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies 🔧
Expand All @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/sphinx_to_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
workflow_call:

jobs:
run-quality-assurance:
uses: ./.github/workflows/qa_tests.yml
run-quality-control:
uses: ./.github/workflows/qc_tests.yml
build-pages:
runs-on: ubuntu-latest
needs:
- run-quality-assurance
# needs:
# - run-quality-control # TODO: only temporary
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
113 changes: 33 additions & 80 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,107 +6,73 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-executables-have-shebangs
- id: detect-private-key
- id: mixed-line-ending
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
# - id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker

- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
- id: fix-encoding-pragma
args: ["--remove"]
- id: forbid-new-submodules
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
rev: v0.39.0
hooks:
- id: markdownlint
args: ["--disable", "MD013"] # ignore line length

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject
# files: "./software/python-package/pyproject.toml"

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-use-type-annotations
# - id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py310-plus", "--keep-runtime-typing"]

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
# NOTE: entries are copy of .flake8-config-file -> for auto-install
### Bugs
- flake8-bugbear
- flake8-secure-coding-standard
- flake8-bandit
- flake8-builtins

### Clean Code
- flake8-comprehensions
- flake8-simplify
- flake8-eradicate

### Limitations
- flake8-blind-except
- flake8-logging-format
- flake8-print

### Documentation
- flake8-comments
# - flake8-docstrings
# - flake8-rst-docstrings

### Test-Improvements
- flake8-assertive

### Load Config from ...
- flake8-pyproject

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.1'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.2.2'
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format
# manual run: ruff check . --preview

# TODO: disable, until bug is resolved, maybe connected to
# https://github.com/ansible/ansible-lint/issues/3636
# - repo: https://github.com/ansible-community/ansible-lint.git
# rev: v6.20.3
# rev: v6.22.1
# hooks:
# - id: ansible-lint

Expand All @@ -124,14 +90,8 @@ repos:
additional_dependencies: ["tomli"] # for py<3.11
exclude: \.(sch|brd|lbr)$

# - repo: https://github.com/amperser/proselint
# rev: 0.13.0
# hooks:
# - id: proselint
# types_or: ["markdown", "rst"]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.3
rev: v17.0.6
hooks:
- id: clang-format
types_or: [c++, c]
Expand Down Expand Up @@ -168,7 +128,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 @@ -178,11 +137,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
Loading

0 comments on commit 291ae5f

Please sign in to comment.