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

Check formatting as part of the CI #2193

Merged
merged 9 commits into from
Jun 26, 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
36 changes: 36 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check cpp formatting

on:
push:
branches:
- develop
- feature/*
- features/*
- fix/*

jobs:
build:
name: clang-format

runs-on: ubuntu-24.04

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

- name: Print version
run: clang-format --version

- name: clang-format
run: cd src && ./format-code.sh

- name: git diff
run: |
DIFF=`git status --porcelain`
if [[ $DIFF ]]; then
echo "The following files are not well formatted"
echo "$DIFF"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upload diff file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to dl & apply the patch ;)

exit 1
else
echo "Code is well formatted, congrats !"
fi
3 changes: 0 additions & 3 deletions src/libs/antares/antlr-interface/ExprBaseVisitor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

// Generated from Expr.g4 by ANTLR 4.13.1


#include "ExprBaseVisitor.h"


144 changes: 77 additions & 67 deletions src/libs/antares/antlr-interface/ExprBaseVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,88 @@

#pragma once


#include "antlr4-runtime.h"
#include "ExprVisitor.h"

#include "antlr4-runtime.h"

/**
* This class provides an empty implementation of ExprVisitor, which can be
* extended to create a visitor which only needs to handle a subset of the available methods.
*/
class ExprBaseVisitor : public ExprVisitor {
class ExprBaseVisitor: public ExprVisitor
{
public:

virtual std::any visitFullexpr(ExprParser::FullexprContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitShift(ExprParser::ShiftContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitIdentifier(ExprParser::IdentifierContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitNegation(ExprParser::NegationContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitExpression(ExprParser::ExpressionContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitComparison(ExprParser::ComparisonContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitAddsub(ExprParser::AddsubContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitPortField(ExprParser::PortFieldContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitMuldiv(ExprParser::MuldivContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitNumber(ExprParser::NumberContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitTimeIndex(ExprParser::TimeIndexContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitTimeShift(ExprParser::TimeShiftContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitFunction(ExprParser::FunctionContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitTimeShiftRange(ExprParser::TimeShiftRangeContext *ctx) override {
return visitChildren(ctx);
}

virtual std::any visitTimeRange(ExprParser::TimeRangeContext *ctx) override {
return visitChildren(ctx);
}


virtual std::any visitFullexpr(ExprParser::FullexprContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitShift(ExprParser::ShiftContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitIdentifier(ExprParser::IdentifierContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitNegation(ExprParser::NegationContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitExpression(ExprParser::ExpressionContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitComparison(ExprParser::ComparisonContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitAddsub(ExprParser::AddsubContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitPortField(ExprParser::PortFieldContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitMuldiv(ExprParser::MuldivContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitNumber(ExprParser::NumberContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitTimeIndex(ExprParser::TimeIndexContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitTimeShift(ExprParser::TimeShiftContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitFunction(ExprParser::FunctionContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitTimeShiftRange(ExprParser::TimeShiftRangeContext* ctx) override
{
return visitChildren(ctx);
}

virtual std::any visitTimeRange(ExprParser::TimeRangeContext* ctx) override
{
return visitChildren(ctx);
}
};

Loading
Loading