Skip to content

Commit 5a7c1c1

Browse files
[MERGE] Version 2.0.0-rc0
* From PR #158 (patch-branch-name-dyn-113): Fix for .github/workflows/Tests.yml [DOCUMENTATION] implemented dynamic branch feature for docs (- WIP #113 -) * From PR #159 (Feature-replace-stickler): [PATCH] Update docs/FAQ.md [PATCH] Fixed some typos Part 7 [PAATCH] Apply suggestions from code review [PATCH] Fixed some typos Part 6 [PATCH] Fixed some typos Part 5 [PATCH] Fixed some typos Part 4 [PATCH] Fixed some typos Part 3 [PATCH] Fixed some typos Part 2 [PATCH] Fixed some typos [DOCUMENTATION] Reformated as per linter (- WIP PR #159 -) [DOCUMENTATION] reformated as per linter (- WIP PR #159 -) [DOCUMENTATION] Reformating FAQ as per linter (- WIP PR #159 -) [PATCH] more fixes for CI.md [DOCUMENTATION] Updated and reformated as per linting (- WIP #73 & PR #159 -) [DOCUMENTATION] reformatting markdown as per linting (- WIP PR #159 -) [DOCUMENTATION] reformatting markdown as per linting (- WIP #79 & PR #159 -) [UPDATE] Apply suggestions from code review [PATCH] possible fix for makefile-lint part 8 [PATCH] possible fix for makefile-lint part 7 [PATCH] possible fix for makefile-lint part 6 [PATCH] possible fix for makefile-lint part 5 [PATCH] possible fix for makefile-lint part 4 [PATCH] possible fix for makefile-lint part 3 [PATCH] possible fix for makefile-lint part 2 [PATCH] possible fix for makefile-lint [PATCH] fix to install go-lang for checkmake (- WIP #159 -) Update .github/workflows/makefile-lint.yml Fix for .github/workflows/makefile-lint.yml [CI] Implemented makefile linter workflow (- WIP #55 -) [CI] Added yaml and markdown linting jobs to CI * From PR #160 (patch-version-parsing): Minor fix for tests/check_pip [TESTING] Implemented check_command in test scripts (- WIP #126 -) [TESTING] Implemented idea to use packaging to parse PEP 440 versions (- WIP #156 -) [TESTING] Use version to parse versions
3 parents dc3a913 + 19d6ac4 + 00e358f commit 5a7c1c1

24 files changed

+992
-226
lines changed

.coderabbit.yaml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# .coderabbit.yaml
2+
language: en
3+
early_access: true
4+
enable_free_tier: true
5+
reviews:
6+
enabled: true
7+
profile: chill
8+
instructions: >-
9+
# Code Review Instructions
10+
11+
- Ensure the code follows best practices and coding standards.
12+
- For **Python** code, follow
13+
[PEP 20](https://www.python.org/dev/peps/pep-0020/) and
14+
[CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161)
15+
standards.
16+
- For **BASH** and **Shellscript** code, follow
17+
[Pure BASH Bible](https://github.com/dylanaraps/pure-bash-bible) and
18+
[CEP-5](https://gist.github.com/reactive-firewall/3d2bd3cf37f87974df6f7bee31a05a89)
19+
standards.
20+
- Check all **BASH** files start with an
21+
[extensive disclaimer](https://gist.github.com/reactive-firewall/866b42d175ae3ebefcb2a5878b30ea17).
22+
- Check for security vulnerabilities and potential issues.
23+
- Ensure the code follows the **DRY, AHA, and SOLID** principles.
24+
25+
# Documentation Review Instructions
26+
- Verify that documentation and comments are clear and comprehensive.
27+
- Verify that documentation and comments are free of spelling mistakes.
28+
- Verify that technical documentation includes a "References" section at
29+
the end of documentation, using the same format as actual RFCs, with
30+
both "Normative References" and "Informative References".
31+
32+
# Test Code Review Instructions
33+
- Ensure that test code is automated, comprehensive, and follows testing best practices.
34+
- Verify that all critical functionality is covered by tests.
35+
- Ensure that test code follow
36+
[CEP-8](https://gist.github.com/reactive-firewall/d840ee9990e65f302ce2a8d78ebe73f6)
37+
38+
# Misc.
39+
- Confirm that the code meets the project's requirements and objectives.
40+
- Confirm that copyright years are up-to date whenever a file is changed.
41+
request_changes_workflow: true
42+
high_level_summary: true
43+
high_level_summary_placeholder: '@coderabbitai summary'
44+
auto_title_placeholder: '@coderabbitai'
45+
review_status: true
46+
poem: true
47+
collapse_walkthrough: false
48+
sequence_diagrams: true
49+
changed_files_summary: true
50+
labeling_instructions:
51+
- label: Python Lang
52+
instructions: Apply when the PR/MR contains changes to python source-code.
53+
- label: Bash Lang
54+
instructions: >-
55+
Apply when the PR/MR contains changes to shell-scripts or BASH code
56+
snippets.
57+
- label: Make Lang
58+
instructions: >-
59+
Apply when the PR/MR contains changes to the file `Makefile` or makefile
60+
code snippets.
61+
- label: Documentation
62+
instructions: >-
63+
Apply whenever project documentation (namely markdown source-code) is
64+
updated by the PR/MR. Also apply when PR contains a commit with a commit
65+
message prefixed with "[DOCUMENTATION] "
66+
- label: Linter
67+
instructions: >-
68+
Apply when the purpose of the PR/MR is related to fixing the feedback
69+
from a linter. Also apply if suggested fixes are used and improve the
70+
code's compliance with the PEP-8 standard.
71+
path_filters: ['!*.xc*/**', '!node_modules/**', '!dist/**', '!build/**', '!.git/**', '!venv/**', '!__pycache__/**']
72+
path_instructions:
73+
- path: README.md
74+
instructions: >-
75+
1. Consider the file 'README.md' the overview/introduction of the project.
76+
Also consider the 'README.md' file the first place to look for project documentation.
77+
78+
2. When reviewing the file 'README.md' it should be linted with help
79+
from the tools `markdownlint` and `languagetool`, pointing out any issues.
80+
81+
3. You may assume the file 'README.md' will contain GitHub flavor Markdown.
82+
- path: '**/*.py'
83+
instructions: >-
84+
When reviewing Python code for this project:
85+
86+
1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
87+
88+
2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
89+
90+
3. As a style convention, consider the code style advocated in [CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161) and evaluate suggested changes for code style compliance.
91+
92+
4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
93+
94+
5. As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.
95+
96+
6. Verify Flake8's configuration file is located at ".flake8.ini"
97+
- path: tests/*
98+
instructions: >-
99+
When reviewing test code:
100+
101+
1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
102+
103+
2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
104+
105+
3. As a style convention, consider the code style advocated in [CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161) and evaluate suggested changes for code style compliance, pointing out any violations discovered.
106+
107+
4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
108+
109+
5. As a project rule, Python source files with names prefixed by the string "test_" and located in the project's "tests" directory are the project's unit-testing code. It is safe, albeit a heuristic, to assume these are considered part of the project's minimal acceptance testing unless a justifying exception to this assumption is documented.
110+
111+
6. As a project rule, any files without extensions and with names prefixed by either the string "check_" or the string "test_", and located in the project's "tests" directory, are the project's non-unit test code. "Non-unit test" in this context refers to any type of testing other than unit testing, such as (but not limited to) functional testing, style linting, regression testing, etc. It can also be assumed that non-unit testing code is usually written as Bash shell scripts.
112+
- path: requirements.txt
113+
instructions: >-
114+
* The project's own Python dependencies are recorded in 'requirements.txt' for production code.
115+
116+
* The project's testing-specific Python dependencies are recorded in 'tests/requirements.txt' and are used for testing the project.
117+
118+
* The project's documentation-specific Python dependencies are recorded in 'docs/requirements.txt' and are used only for generating Python-focused documentation for the project. 'docs/requirements.txt' may be absent if not applicable.
119+
120+
Consider these 'requirements.txt' files the records of truth regarding project dependencies.
121+
- path: tests/requirements.txt
122+
instructions: >-
123+
* The multicast project's own dependencies are recorded in
124+
'./requirements.txt' for production code.
125+
126+
* The multicast project's own test code dependencies are recorded in
127+
'tests/requirements.txt' for testing the project.
128+
129+
Consider these the records of truth regarding project test code dependencies.
130+
- path: .github/**
131+
instructions: >-
132+
* When the project is hosted on GitHub: All GitHub-specific configurations, templates, and tools should be found in the '.github' directory tree.
133+
134+
* 'actionlint' erroneously generates false positives when dealing with GitHub's `${{ ... }}` syntax in conditionals.
135+
136+
* 'actionlint' erroneously generates incorrect solutions when suggesting the removal of valid `${{ ... }}` syntax.
137+
- path: docs/*
138+
instructions: >-
139+
When a project contains a `docs/` directory:
140+
141+
1. Consider the files in the `docs/` directory tree the core/main/in-depth documentation of the project. Also consider the 'docs/**.md' files the second place to look for project documentation after the 'README.md' file.
142+
143+
2. When reviewing the documentation files (e.g. `docs/**.md`), they should additionally be linted with help from the tool `markdownlint`, pointing out any issues.
144+
145+
3. When reviewing the documentation files in `docs/` directory, they should additionally be linted with help from the tool `languagetool`, pointing out any issues.
146+
abort_on_close: true
147+
auto_review:
148+
enabled: true
149+
auto_incremental_review: true
150+
ignore_title_keywords: []
151+
labels: []
152+
drafts: false
153+
base_branches:
154+
- stable
155+
- master
156+
- HOTFIX-*
157+
tools:
158+
languagetool:
159+
enabled: true
160+
language: en-US
161+
configuration:
162+
level: picky
163+
mother_tongue: en
164+
dictionary:
165+
- 'reactive-firewall'
166+
- 'CEP-9'
167+
- 'CEP-8'
168+
- 'CEP-7'
169+
- 'CEP-5'
170+
- 'Shellscript'
171+
- 'bash'
172+
disabled_rules:
173+
- EN_QUOTES
174+
- CONSECUTIVE_SPACES
175+
enabled_rules:
176+
- STYLE
177+
- EN_CONTRACTION_SPELLING
178+
- EN_WORD_COHERENCY
179+
- IT_IS_OBVIOUS
180+
- TWELFTH_OF_NEVER
181+
- OXFORD_SPELLING
182+
- PASSIVE_VOICE
183+
shellcheck:
184+
enabled: true
185+
ruff:
186+
enabled: true
187+
configuration:
188+
extend_select:
189+
- E # Pycodestyle errors (style issues)
190+
- F # PyFlakes codes (logical errors)
191+
- W # Pycodestyle warnings
192+
- N # PEP 8 naming conventions
193+
ignore:
194+
- W191
195+
- W391
196+
- E117
197+
- D208
198+
line_length: 100
199+
dummy_variable_rgx: '^(_.*|junk|extra)$' # Variables starting with '_' or named 'junk' or 'extras', are considered dummy variables
200+
external:
201+
flake8-blind-except: {}
202+
flake8-docstrings: {}
203+
flake8-comprehensions: {}
204+
flake8-debugger: {}
205+
flake8-eradicate: {}
206+
# Include other Flake8 plugins as needed
207+
markdownlint:
208+
enabled: true
209+
yamllint:
210+
enabled: true
211+
configuration_file: ".yamllint.conf"
212+
chat:
213+
auto_reply: true

.github/tool_checkmake.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#! /bin/bash
2+
# Disclaimer of Warranties.
3+
# A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY
4+
# APPLICABLE LAW, USE OF THIS SHELL SCRIPT AND ANY SERVICES PERFORMED
5+
# BY OR ACCESSED THROUGH THIS SHELL SCRIPT IS AT YOUR SOLE RISK AND
6+
# THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND
7+
# EFFORT IS WITH YOU.
8+
#
9+
# B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SHELL SCRIPT
10+
# AND SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE", WITH ALL FAULTS AND
11+
# WITHOUT WARRANTY OF ANY KIND, AND THE AUTHOR OF THIS SHELL SCRIPT'S LICENSORS
12+
# (COLLECTIVELY REFERRED TO AS "THE AUTHOR" FOR THE PURPOSES OF THIS DISCLAIMER)
13+
# HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THIS SHELL SCRIPT
14+
# SOFTWARE AND SERVICES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
15+
# NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF
16+
# MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE,
17+
# ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS.
18+
#
19+
# C. THE AUTHOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE
20+
# THE AUTHOR's SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR
21+
# SERVICES PERFORMED OR PROVIDED BY, THIS SHELL SCRIPT WILL MEET YOUR
22+
# REQUIREMENTS, THAT THE OPERATION OF THIS SHELL SCRIPT OR SERVICES WILL
23+
# BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE
24+
# AVAILABLE, THAT THIS SHELL SCRIPT OR SERVICES WILL BE COMPATIBLE OR
25+
# WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES,
26+
# OR THAT DEFECTS IN THIS SHELL SCRIPT OR SERVICES WILL BE CORRECTED.
27+
# INSTALLATION OF THIS THE AUTHOR SOFTWARE MAY AFFECT THE USABILITY OF THIRD
28+
# PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES.
29+
#
30+
# D. YOU FURTHER ACKNOWLEDGE THAT THIS SHELL SCRIPT AND SERVICES ARE NOT
31+
# INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE
32+
# OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN, THE CONTENT, DATA OR
33+
# INFORMATION PROVIDED BY THIS SHELL SCRIPT OR SERVICES COULD LEAD TO
34+
# DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE,
35+
# INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
36+
# NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR
37+
# WEAPONS SYSTEMS.
38+
#
39+
# E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY THE AUTHOR
40+
# SHALL CREATE A WARRANTY. SHOULD THIS SHELL SCRIPT OR SERVICES PROVE DEFECTIVE,
41+
# YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
42+
#
43+
# Limitation of Liability.
44+
# F. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL THE AUTHOR
45+
# BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR
46+
# CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES
47+
# FOR LOSS OF PROFITS, CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR
48+
# RECEIVE ANY DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER
49+
# COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR
50+
# INABILITY TO USE THIS SHELL SCRIPT OR SERVICES OR ANY THIRD PARTY
51+
# SOFTWARE OR APPLICATIONS IN CONJUNCTION WITH THIS SHELL SCRIPT OR
52+
# SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT,
53+
# TORT OR OTHERWISE) AND EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
54+
# POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
55+
# OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR
56+
# CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event
57+
# shall THE AUTHOR's total liability to you for all damages (other than as may
58+
# be required by applicable law in cases involving personal injury) exceed
59+
# the amount of five dollars ($5.00). The foregoing limitations will apply
60+
# even if the above stated remedy fails of its essential purpose.
61+
################################################################################
62+
#
63+
# .github/tool_checkmake.sh
64+
FILE="${1}" ;
65+
EMSG="Checkmake linter complained.";
66+
67+
# Check if file exists
68+
if [[ ! ( -f "${FILE}" ) ]]; then
69+
printf "%s\n" "::error file=${FILE},title=MISSING:: File '${FILE}' not found." >&2
70+
exit 1
71+
fi
72+
73+
# Main functionality
74+
{ { checkmake "${FILE}" | sed -e 's/ /:/g' | tr -s ':' |\
75+
cut -d: -f 3-5 ;} 2>/dev/null |\
76+
grep -F "${FILE}" | sed -E -e 's/^[[:space:]]+//g' |\
77+
xargs -I{} printf "::warning file=${FILE},title=LINT::%s ${EMSG}\n" {} >&2 ;}
78+
wait ;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# .github/workflows/makefile-lint.yml
2+
---
3+
name: Makefile Lint
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main", "master", "stable", feature*]
7+
pull_request:
8+
branches: ["main", "master", "stable"]
9+
10+
permissions: {} # Setting default permissions to none for enhanced security
11+
12+
jobs:
13+
makefile-lint:
14+
permissions:
15+
contents: read
16+
statuses: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install Apt-Get Dependencies
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y yamllint golang-go pandoc
24+
go version
25+
- name: Lint Workflow YAML
26+
run: |
27+
yamllint -f github --no-warnings .github/workflows/makefile-lint.yml
28+
- uses: actions/checkout@v4
29+
- name: Install checkmake
30+
if: ${{ success() }}
31+
env:
32+
BUILDER_NAME: "ci"
33+
BUILDER_EMAIL: "no-reply@localhost"
34+
run: |
35+
git clone https://github.com/mrtazz/checkmake.git checkmake
36+
cd checkmake
37+
make
38+
cd ..
39+
- name: Get makefiles Files
40+
id: makefiles
41+
shell: bash
42+
run: |
43+
FILES=$(git ls-files --exclude-standard -- Makefile 2>/dev/null)
44+
if [ -z "$FILES" ]; then
45+
printf "%s\n" "No Makefiles found."
46+
printf "%s\n" "files=" >> "$GITHUB_OUTPUT"
47+
else
48+
printf "%s\n" "Makefiles found:"
49+
printf "%s\n" "$FILES"
50+
# Replace line breaks with spaces for tools
51+
FILES="${FILES//$'\n'/ }"
52+
printf "%s\n" "files=$FILES" >> "$GITHUB_OUTPUT"
53+
fi
54+
if: ${{ success() }}
55+
- name: Lint Makefiles Files
56+
run: |
57+
FILE="${{ steps.makefiles.outputs.files }}" ;
58+
printf "::group::%s\n" "${FILE}" ;
59+
.github/tool_checkmake.sh "${FILE}" ;
60+
printf "::endgroup::\n" ; unset FILE 2>/dev/null || true ;
61+
if: ${{ !cancelled() && steps.makefiles.outputs.files != '' }}

0 commit comments

Comments
 (0)