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

Feature/proper code linting #23

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading