Skip to content

Commit

Permalink
Merge pull request #23 from TomVer99/feature/proper-code-linting
Browse files Browse the repository at this point in the history
Feature/proper code linting
  • Loading branch information
TomVer99 authored Feb 9, 2024
2 parents 51ab5d9 + 4c079f5 commit 33c4f12
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 248 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
BasedOnStyle: Google
...
11 changes: 5 additions & 6 deletions .github/workflows/Code-Hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ on:
run-name: ${{ inputs.reason || github.event.pull_request.title || github.event.head_commit.message || 'unexpected workflow trigger' }}

jobs:
linelint:
lint:
runs-on: ubuntu-latest
name: Check for newline at end of file
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Linelint
uses: fernandrone/[email protected]
- name: lint
run: |
find . -name '*.h' -or -name '*.hpp' -or -name '*.cpp' | xargs clang-format --dry-run --Werror
68 changes: 32 additions & 36 deletions src/Example/example.cpp
Original file line number Diff line number Diff line change
@@ -1,56 +1,52 @@
//######################################################################
//# #
//# C++ File #
//# #
//######################################################################
// ######################################################################
// # #
// # C++ File #
// # #
// ######################################################################

/**
* @file example.cpp
*
*
* @brief Brief description of the file.
*
*
* @details Detailed description of the file. (optional)
*
*
* @author XXXX
* @date YYYY-MM-DD
*/

//######################################################################
//# #
//# Own Includes #
//# #
//######################################################################
// ######################################################################
// # #
// # Own Includes #
// # #
// ######################################################################

#include "example.hpp"

//######################################################################
//# #
//# System Includes #
//# #
//######################################################################
// ######################################################################
// # #
// # System Includes #
// # #
// ######################################################################

#include <iostream>

namespace Example
{
namespace Example {

//######################################################################
//# #
//# Local constants / Defines #
//# #
//######################################################################
// ######################################################################
// # #
// # Local constants / Defines #
// # #
// ######################################################################

//######################################################################
//# #
//# Functions / Methods #
//# #
//######################################################################
// ######################################################################
// # #
// # Functions / Methods #
// # #
// ######################################################################

void PrintHelloWorld()
{
std::cout << "Hello World!" << std::endl;
}
void PrintHelloWorld() { std::cout << "Hello World!" << std::endl; }

} // namespace Example
} // namespace Example

//########################### End of File ############################
// ########################### End of File ############################
73 changes: 36 additions & 37 deletions src/Example/example.hpp
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
//######################################################################
//# #
//# H++ File #
//# #
//######################################################################
// ######################################################################
// # #
// # H++ File #
// # #
// ######################################################################

/**
* @file example.hpp
*
*
* @brief Brief description of the file.
*
*
* @details Detailed description of the file. (optional)
*
*
* @author XXXX
* @date YYYY-MM-DD
*/

#ifndef EXAMPLE_HPP
#define EXAMPLE_HPP

//######################################################################
//# #
//# Own Includes #
//# #
//######################################################################

//######################################################################
//# #
//# System Includes #
//# #
//######################################################################

namespace Example
{

//######################################################################
//# #
//# Global constants / Defines #
//# #
//######################################################################

//######################################################################
//# #
//# Class / Function prototypes #
//# #
//######################################################################
// ######################################################################
// # #
// # Own Includes #
// # #
// ######################################################################

// ######################################################################
// # #
// # System Includes #
// # #
// ######################################################################

namespace Example {

// ######################################################################
// # #
// # Global constants / Defines #
// # #
// ######################################################################

// ######################################################################
// # #
// # Class / Function prototypes #
// # #
// ######################################################################

void PrintHelloWorld();

} // namespace Example
} // namespace Example

#endif //EXAMPLE_HPP
#endif // EXAMPLE_HPP

//########################### End of File ############################
// ########################### End of File ############################
79 changes: 39 additions & 40 deletions src/NestedDirExample/NestedDir/nestedBottom.cpp
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
//######################################################################
//# #
//# C++ File #
//# #
//######################################################################
// ######################################################################
// # #
// # C++ File #
// # #
// ######################################################################

/**
* @file nestedBottom.cpp
*
*
* @brief Brief description of the file.
*
*
* @details Detailed description of the file. (optional)
*
*
* @author XXXX
* @date YYYY-MM-DD
*/

//######################################################################
//# #
//# Own Includes #
//# #
//######################################################################
// ######################################################################
// # #
// # Own Includes #
// # #
// ######################################################################

#include "nestedBottom.hpp"

#include <nestedTop.hpp>

//######################################################################
//# #
//# System Includes #
//# #
//######################################################################
// ######################################################################
// # #
// # System Includes #
// # #
// ######################################################################

#include <iostream>

namespace Example
{

//######################################################################
//# #
//# Local constants / Defines #
//# #
//######################################################################

//######################################################################
//# #
//# Functions / Methods #
//# #
//######################################################################

void PrintHelloWorldC()
{
std::cout << "Calling \"Hello World!B\" from Hello World!C" << std::endl;
PrintHelloWorldB();
std::cout << "Hello World!C" << std::endl;
namespace Example {

// ######################################################################
// # #
// # Local constants / Defines #
// # #
// ######################################################################

// ######################################################################
// # #
// # Functions / Methods #
// # #
// ######################################################################

void PrintHelloWorldC() {
std::cout << "Calling \"Hello World!B\" from Hello World!C" << std::endl;
PrintHelloWorldB();
std::cout << "Hello World!C" << std::endl;
}

} // namespace Example
} // namespace Example

//########################### End of File ############################
// ########################### End of File ############################
73 changes: 36 additions & 37 deletions src/NestedDirExample/NestedDir/nestedBottom.hpp
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
//######################################################################
//# #
//# H++ File #
//# #
//######################################################################
// ######################################################################
// # #
// # H++ File #
// # #
// ######################################################################

/**
* @file nestedBottom.hpp
*
*
* @brief Brief description of the file.
*
*
* @details Detailed description of the file. (optional)
*
*
* @author XXXX
* @date YYYY-MM-DD
*/

#ifndef NESTED_BOTTOM_HPP
#define NESTED_BOTTOM_HPP

//######################################################################
//# #
//# Own Includes #
//# #
//######################################################################

//######################################################################
//# #
//# System Includes #
//# #
//######################################################################

namespace Example
{

//######################################################################
//# #
//# Global constants / Defines #
//# #
//######################################################################

//######################################################################
//# #
//# Class / Function prototypes #
//# #
//######################################################################
// ######################################################################
// # #
// # Own Includes #
// # #
// ######################################################################

// ######################################################################
// # #
// # System Includes #
// # #
// ######################################################################

namespace Example {

// ######################################################################
// # #
// # Global constants / Defines #
// # #
// ######################################################################

// ######################################################################
// # #
// # Class / Function prototypes #
// # #
// ######################################################################

void PrintHelloWorldC();

} // namespace Example
} // namespace Example

#endif //NESTED_BOTTOM_HPP
#endif // NESTED_BOTTOM_HPP

//########################### End of File ############################
// ########################### End of File ############################
Loading

0 comments on commit 33c4f12

Please sign in to comment.