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

Develop #478

Merged
merged 70 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
45d1285
chore(pylint): add .pylintrc configuration file
kluge7 Sep 23, 2024
7727642
refactor: fix pylint warning W1510
kluge7 Sep 23, 2024
b17fd24
refactor: fix pylint warning C0116
kluge7 Sep 23, 2024
d6766cf
refactor: fix pylint warning C0411
kluge7 Sep 23, 2024
9f9cd12
refactor: fix pylint warning R1731
kluge7 Sep 23, 2024
47f38a0
refactor: fix pylint warning R1705
kluge7 Sep 23, 2024
9ba7724
refactor: fix pylint warning W1514
kluge7 Sep 23, 2024
90eacac
refactor: fix pylint warning C0200
kluge7 Sep 23, 2024
e4fb07f
refactor: fix pylint warning W0611
kluge7 Sep 23, 2024
d4e3331
refactor: fix pylint warning W0702
kluge7 Sep 23, 2024
8478f60
refactor: fix pylint warning C0121
kluge7 Sep 23, 2024
e49408b
refactor: fix pylint warning W0107
kluge7 Sep 23, 2024
f971a79
refactor: fix pylint warning R1714
kluge7 Sep 23, 2024
6953afc
refactor: fix pylint warning C0201
kluge7 Sep 23, 2024
3e24960
refactor: fix pylint warning C0303 and W0613
kluge7 Sep 23, 2024
73f7e1d
refactor: fix pylint warning W0621
kluge7 Sep 23, 2024
6349e1e
refactor: fix pylint warning R0402
kluge7 Sep 23, 2024
3296c3e
refactor: fix pylint warning W0212
kluge7 Sep 23, 2024
36bd73f
chore(pylint): update rule adjustments and formatting
kluge7 Sep 23, 2024
44f683e
style: format code with black
kluge7 Sep 23, 2024
5dae721
style: format imports with isort
kluge7 Sep 23, 2024
61a507c
ci: add isort and pylint to Python pipeline
kluge7 Sep 23, 2024
a0aa60e
Committing black-format changes
Sep 23, 2024
13c3e23
chore: add pyproject.toml for project configuration
kluge7 Sep 23, 2024
45e2919
ci: update order of pipeline jobs
kluge7 Sep 23, 2024
975ed60
ci: update pylint job and pylint rules
kluge7 Sep 23, 2024
154d2e6
ci: update which python versions pylint test
kluge7 Sep 23, 2024
fc9ebef
ci: update python pipeline to only run on pull_request
kluge7 Sep 23, 2024
002fb32
refactor: fix pylint warning C0103
kluge7 Sep 23, 2024
36699f4
chore: update linting and project configuration rules in .pylintrc an…
kluge7 Sep 23, 2024
d01b76b
Rename files to snake_case
kluge7 Sep 23, 2024
c5eff24
ci: add pipeline for grammar in comments
kluge7 Sep 24, 2024
d7cee00
refactor: fix spelling mistakes in comments
kluge7 Sep 24, 2024
399294c
ci: update job codespell_fix to continue on error
kluge7 Sep 24, 2024
369d7d6
refactor: fix spelling mistakes in comments
kluge7 Sep 24, 2024
cd305d5
ci: update pipeline codespell to only have one job
kluge7 Sep 24, 2024
377f8c1
refactor: fix variable naming issues and adjust imports as per review
kluge7 Sep 24, 2024
8497150
Committing codespell fixes
Sep 24, 2024
b01102a
refactor: spelling correction
Hallfred Sep 24, 2024
428ede3
ci: update CI file and job names for consistency
kluge7 Sep 24, 2024
f26643a
ci: update CI file for more clarity
kluge7 Sep 24, 2024
de9c3de
chore: add codespell configuration and ignore list
kluge7 Sep 24, 2024
99b8d20
chore: add type hints and return types
kluge7 Sep 25, 2024
6dc658a
ci: add mypy.ini for type checking configuration
kluge7 Sep 25, 2024
fd50092
ci: add mypy type checking workflow
kluge7 Sep 25, 2024
352e8ab
refactor: format code with black
kluge7 Sep 25, 2024
4a3e1c2
refactor: format all yaml files using prettier
kluge7 Sep 25, 2024
aad0bfc
ci: add pipeline for yaml formatting using prettier
kluge7 Sep 25, 2024
fd63bea
ci: update yaml formatting pipeline to run on pull request
kluge7 Sep 25, 2024
99c5646
refactor: remove deprecated typing
kluge7 Sep 27, 2024
bcd5cc4
refactor: fix import sorting
kluge7 Sep 27, 2024
0cd2b87
Merge pull request #467 from vortexntnu/463-task-address-pylint-linti…
kluge7 Sep 27, 2024
6671103
ci: remove faulty ci pipelines and combine python pipelines into sing…
kluge7 Sep 30, 2024
2feb5a1
fix(security): replace subprocess call with safer alternative to remo…
kluge7 Sep 30, 2024
9005aed
Merge pull request #475 from vortexntnu/463-task-set-up-cicd-pipeline…
kluge7 Sep 30, 2024
5b82a3e
feat: add pre-commit hooks for black, isort, and codespell
kluge7 Sep 30, 2024
97802a7
ci: update python pipeline to use latest versions
kluge7 Sep 30, 2024
218f22c
refactor: apply code formatting fixes via pre-commit hooks
kluge7 Oct 1, 2024
ec433cc
ci: split python ci/cd pipelines into multiple files
kluge7 Oct 1, 2024
52fdd3e
ci: add ci pipeline for checking style clang-format
kluge7 Oct 1, 2024
3f8c4e6
refactor: remove unused config file for clang-format
kluge7 Oct 1, 2024
32a0f1c
refactor: remove duplicate file
kluge7 Oct 1, 2024
fe4077a
Merge pull request #476 from vortexntnu/470-task-set-up-cicd-pipeline…
kluge7 Oct 1, 2024
b201a7c
ci: add ci pipeline that tests that codebase can build
kluge7 Oct 1, 2024
9311f1a
refactor: update ci-build pipeline to only run on pull request
kluge7 Oct 2, 2024
3a1c955
refactor: update clang-format config
kluge7 Oct 4, 2024
f0cbb85
refactor: apply clang-format
kluge7 Oct 4, 2024
07848e0
feat: update pipeline to build and run tests
kluge7 Oct 5, 2024
b5a1dc9
refactor: disable linting checks when running colcon test
kluge7 Oct 5, 2024
6f489c3
Merge pull request #477 from vortexntnu/ci-make-pipeline-build
kluge7 Oct 5, 2024
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
139 changes: 4 additions & 135 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,137 +1,6 @@
---
Language: Cpp
# BasedOnStyle: LLVM
IndentWidth: 2
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
...

UseTab: Never
ColumnLimit: 0
NamespaceIndentation: All
1 change: 1 addition & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theses
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# File containing words to ignore during the spell check.
ignore-words = .codespellignore

# Check file names as well.
check-filenames = true
23 changes: 23 additions & 0 deletions .github/workflows/bandit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Bandit Security Scan

on: [pull_request]

jobs:
bandit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install bandit
run: |
python -m pip install bandit[toml]

- name: Run bandit scan
run: |
bandit -c pyproject.toml -r . --severity-level medium
28 changes: 0 additions & 28 deletions .github/workflows/black-formatter.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Black Code Formatter Check

on: [pull_request]

jobs:
black:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install black
run: |
python -m pip install black

- name: Run black
run: |
black --check .
72 changes: 72 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build and Test

on: [pull_request]

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install ROS 2 Humble
run: |
sudo apt update
sudo apt install -y curl gnupg lsb-release

# Add the ROS 2 GPG key
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

# Add the ROS 2 repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update

# Install ROS 2 Humble desktop version
sudo apt install -y ros-humble-desktop

- name: Install Build Tools and Dependencies
run: |
sudo apt install -y python3-colcon-common-extensions python3-rosdep

# Initialize rosdep
sudo rosdep init
rosdep update

- name: Set up ROS 2 Workspace
run: |
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src

# Copy the repository code to the workspace src folder
cp -r $GITHUB_WORKSPACE/* .

# Clone vortex-msgs repository
git clone https://github.com/vortexntnu/vortex-msgs.git

# Go back to workspace root
cd ~/ros2_ws

- name: Install Package Dependencies with rosdep
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y

- name: Build ROS 2 Workspace
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
colcon build --event-handlers console_cohesion+

- name: Run Tests
run: |
source /opt/ros/humble/setup.bash
cd ~/ros2_ws
colcon test --event-handlers console_direct+

- name: Test Results Summary
run: |
cd ~/ros2_ws
colcon test-result --verbose
33 changes: 33 additions & 0 deletions .github/workflows/clang-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Clang-Format Code Style Check

on: [pull_request]

jobs:
clang-format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format

- name: Run clang-format check
run: |
# Find all C/C++ source and header files
find . -type f \( -name '*.c' -o -name '*.cpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.h' -o -name '*.hpp' -o -name '*.hh' -o -name '*.hxx' \) -print0 | xargs -0 clang-format -i

# Check if any files were modified
if [[ $(git status --porcelain) ]]; then
echo "Code is not properly formatted. Please run clang-format."
echo "Modified files:"
git status --porcelain
echo "Differences:"
git --no-pager diff
exit 1
else
echo "All code is properly formatted."
fi
24 changes: 0 additions & 24 deletions .github/workflows/clang-formatter.yml

This file was deleted.

Loading
Loading