Skip to content

Commit

Permalink
Merge pull request #33 from coders-school/clang_format_fix
Browse files Browse the repository at this point in the history
all files formated by clang-format
  • Loading branch information
Vicx95 authored Mar 6, 2024
2 parents 7bd1079 + fba3d87 commit 994771c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ AllowShortIfStatementsOnASingleLine: Never
IndentCaseLabels: false
ColumnLimit: 120
AccessModifierOffset: -4
InsertNewlineAtEOF: true
AlwaysBreakAfterDefinitionReturnType: All
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ repos:
rev: v1.3.5
hooks:
- id: clang-format
args: [--style=Google]
exclude: '^communicator/main.cpp$|^communicator/mainwindow.cpp$|^communicator/mainwindow.h$' #auto generated files
- id: clang-tidy
exclude: '^communicator/main.cpp$|^communicator/mainwindow.cpp$|^communicator/mainwindow.h$|^communicator/tests/exampleTest.cpp$' #auto generated files
- id: cppcheck
Expand Down
8 changes: 4 additions & 4 deletions communicator/main.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "mainwindow.h"

#include <QApplication>

int main(int argc, char *argv[])
{
#include "mainwindow.h"

int
main(int argc, char *argv[]) {
QApplication a(argc, argv);
MainWindow w;
w.show();
Expand Down
13 changes: 3 additions & 10 deletions communicator/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#include "mainwindow.h"

#include "./ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); }

MainWindow::~MainWindow()
{
delete ui;
}
MainWindow::~MainWindow() { delete ui; }
5 changes: 2 additions & 3 deletions communicator/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
class MainWindow : public QMainWindow {
Q_OBJECT

public:
Expand All @@ -20,4 +19,4 @@ class MainWindow : public QMainWindow
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
#endif // MAINWINDOW_H
8 changes: 4 additions & 4 deletions communicator/tests/exampleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

// Demonstrate some basic assertions.
TEST(exampleTest, BasicAssertions) {
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}

0 comments on commit 994771c

Please sign in to comment.