mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 23:57:22 +02:00
Ensure we're more specific about clang format options and include order
This commit is contained in:
parent
2e67906402
commit
e537caf170
@ -2,8 +2,7 @@
|
|||||||
AccessModifierOffset: 0
|
AccessModifierOffset: 0
|
||||||
AlignAfterOpenBracket: true
|
AlignAfterOpenBracket: true
|
||||||
AlignConsecutiveAssignments: false
|
AlignConsecutiveAssignments: false
|
||||||
#uncomment for clang 3.9
|
AlignConsecutiveDeclarations: false
|
||||||
#AlignConsecutiveDeclarations: false
|
|
||||||
AlignEscapedNewlinesLeft: false
|
AlignEscapedNewlinesLeft: false
|
||||||
AlignOperands: true
|
AlignOperands: true
|
||||||
AlignTrailingComments: true
|
AlignTrailingComments: true
|
||||||
@ -14,21 +13,18 @@ AllowShortFunctionsOnASingleLine: None
|
|||||||
AllowShortIfStatementsOnASingleLine: false
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
AllowShortLoopsOnASingleLine: false
|
AllowShortLoopsOnASingleLine: false
|
||||||
# AlwaysBreakAfterDefinitionReturnType: None
|
# AlwaysBreakAfterDefinitionReturnType: None
|
||||||
#uncomment for clang 3.9
|
AlwaysBreakAfterReturnType: None
|
||||||
#AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakBeforeMultilineStrings: true
|
AlwaysBreakBeforeMultilineStrings: true
|
||||||
AlwaysBreakTemplateDeclarations: false
|
AlwaysBreakTemplateDeclarations: false
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: true
|
BinPackParameters: true
|
||||||
# BraceWrapping: (not set since BreakBeforeBraces is not Custom)
|
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
# BreakAfterJavaFieldAnnotations: (not java)
|
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
BreakBeforeBraces: Linux
|
BreakBeforeBraces: Linux
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
BreakConstructorInitializersBeforeComma: false
|
BreakConstructorInitializersBeforeComma: false
|
||||||
#uncomment for clang 3.9
|
# Too new for travis clang-format version
|
||||||
#BreakStringLiterals: false
|
# BreakStringLiterals: false
|
||||||
ColumnLimit: 100
|
ColumnLimit: 100
|
||||||
CommentPragmas: '\*\<'
|
CommentPragmas: '\*\<'
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
@ -39,35 +35,37 @@ DerivePointerAlignment: false
|
|||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
ForEachMacros: [ ]
|
ForEachMacros: [ ]
|
||||||
#Uncomment for clang 3.9
|
SortIncludes: true
|
||||||
#IncludeCategories:
|
# IncludeBlocksStyle changed to IncludeBlocks, between xenial and disco, so we can't use it for consistency
|
||||||
# - Regex: '^"'
|
# IncludeBlocks: Regroup
|
||||||
# Priority: 1
|
IncludeCategories:
|
||||||
|
- Regex: '^"gamemode.h"'
|
||||||
|
Priority: 0
|
||||||
|
- Regex: '^"build-'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^"common-'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '^"gamemode-'
|
||||||
|
Priority: 3
|
||||||
|
- Regex: '^<'
|
||||||
|
Priority: 4
|
||||||
# IncludeIsMainRegex: (project doesn't use a main includes that can add other includes via regex)
|
# IncludeIsMainRegex: (project doesn't use a main includes that can add other includes via regex)
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
# JavaScriptQuotes: (not javascript)
|
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
MacroBlockBegin: ''
|
MacroBlockBegin: ''
|
||||||
MacroBlockEnd: ''
|
MacroBlockEnd: ''
|
||||||
MaxEmptyLinesToKeep: 1
|
MaxEmptyLinesToKeep: 1
|
||||||
NamespaceIndentation: None
|
NamespaceIndentation: None
|
||||||
# ObjCBlockIndentWidth: (not objc)
|
|
||||||
# ObjCSpaceAfterProperty: (not objc)
|
|
||||||
# ObjCSpaceBeforeProtocolList: (not objc)
|
|
||||||
PenaltyBreakBeforeFirstCallParameter: 400
|
PenaltyBreakBeforeFirstCallParameter: 400
|
||||||
PenaltyBreakComment: 0
|
PenaltyBreakComment: 0
|
||||||
# PenaltyBreakFirstLessLess: (not cpp)
|
|
||||||
PenaltyBreakString: 500
|
PenaltyBreakString: 500
|
||||||
PenaltyExcessCharacter: 10000
|
PenaltyExcessCharacter: 10000
|
||||||
PenaltyReturnTypeOnItsOwnLine: 600
|
PenaltyReturnTypeOnItsOwnLine: 600
|
||||||
PointerAlignment: Right
|
PointerAlignment: Right
|
||||||
#uncomment for clang 3.9
|
ReflowComments: true
|
||||||
#ReflowComments: true
|
|
||||||
#uncomment for clang 3.9
|
|
||||||
#SortIncludes: true
|
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
@ -75,7 +73,6 @@ SpaceInEmptyParentheses: false
|
|||||||
SpacesBeforeTrailingComments: 1
|
SpacesBeforeTrailingComments: 1
|
||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
# SpacesInContainerLiterals: (not objc or javascript)
|
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
|
@ -36,8 +36,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "common-helpers.h"
|
#include "common-helpers.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
|
|
||||||
#include "gamemode-config.h"
|
|
||||||
#include "gamemode.h"
|
#include "gamemode.h"
|
||||||
|
#include "gamemode-config.h"
|
||||||
|
|
||||||
#include "build-config.h"
|
#include "build-config.h"
|
||||||
|
|
||||||
@ -602,10 +602,12 @@ int game_mode_context_query_status(GameModeContext *self, pid_t client, pid_t re
|
|||||||
*/
|
*/
|
||||||
static GameModeClient *game_mode_client_new(pid_t pid, char *executable)
|
static GameModeClient *game_mode_client_new(pid_t pid, char *executable)
|
||||||
{
|
{
|
||||||
|
/* clang-format off */
|
||||||
GameModeClient c = {
|
GameModeClient c = {
|
||||||
.next = NULL,
|
.next = NULL,
|
||||||
.pid = pid,
|
.pid = pid,
|
||||||
};
|
};
|
||||||
|
/* clang-format on */
|
||||||
GameModeClient *ret = NULL;
|
GameModeClient *ret = NULL;
|
||||||
|
|
||||||
ret = calloc(1, sizeof(struct GameModeClient));
|
ret = calloc(1, sizeof(struct GameModeClient));
|
||||||
@ -794,4 +796,4 @@ int game_mode_reload_config(GameModeContext *self)
|
|||||||
start_reaper_thread(self);
|
start_reaper_thread(self);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include "common-logging.h"
|
|
||||||
#include "gamemode.h"
|
#include "gamemode.h"
|
||||||
|
#include "common-logging.h"
|
||||||
|
|
||||||
#include <systemd/sd-bus.h>
|
#include <systemd/sd-bus.h>
|
||||||
#include <systemd/sd-daemon.h>
|
#include <systemd/sd-daemon.h>
|
||||||
@ -216,6 +216,7 @@ static int method_refresh_config(sd_bus_message *m, void *userdata,
|
|||||||
/**
|
/**
|
||||||
* D-BUS vtable to dispatch virtual methods
|
* D-BUS vtable to dispatch virtual methods
|
||||||
*/
|
*/
|
||||||
|
/* clang-format off */
|
||||||
static const sd_bus_vtable gamemode_vtable[] = {
|
static const sd_bus_vtable gamemode_vtable[] = {
|
||||||
SD_BUS_VTABLE_START(0),
|
SD_BUS_VTABLE_START(0),
|
||||||
SD_BUS_PROPERTY("ClientCount", "i", property_get_client_count, 0,
|
SD_BUS_PROPERTY("ClientCount", "i", property_get_client_count, 0,
|
||||||
@ -232,6 +233,7 @@ static const sd_bus_vtable gamemode_vtable[] = {
|
|||||||
SD_BUS_METHOD("RefreshConfig", "", "i", method_refresh_config, SD_BUS_VTABLE_UNPRIVILEGED),
|
SD_BUS_METHOD("RefreshConfig", "", "i", method_refresh_config, SD_BUS_VTABLE_UNPRIVILEGED),
|
||||||
SD_BUS_VTABLE_END
|
SD_BUS_VTABLE_END
|
||||||
};
|
};
|
||||||
|
/* clang-format on */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main process loop for the daemon. Run until quitting has been requested.
|
* Main process loop for the daemon. Run until quitting has been requested.
|
||||||
|
@ -37,8 +37,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "common-helpers.h"
|
#include "common-helpers.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
|
|
||||||
#include "gamemode-config.h"
|
|
||||||
#include "gamemode.h"
|
#include "gamemode.h"
|
||||||
|
#include "gamemode-config.h"
|
||||||
|
|
||||||
#include "build-config.h"
|
#include "build-config.h"
|
||||||
|
|
||||||
|
@ -31,10 +31,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include "gamemode.h"
|
||||||
#include "common-helpers.h"
|
#include "common-helpers.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
#include "gamemode-config.h"
|
#include "gamemode-config.h"
|
||||||
#include "gamemode.h"
|
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include "gamemode.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
#include "gamemode-config.h"
|
#include "gamemode-config.h"
|
||||||
#include "gamemode.h"
|
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
@ -37,8 +37,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "common-helpers.h"
|
#include "common-helpers.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
|
|
||||||
#include "gamemode-config.h"
|
|
||||||
#include "gamemode.h"
|
#include "gamemode.h"
|
||||||
|
#include "gamemode-config.h"
|
||||||
#include "gamemode_client.h"
|
#include "gamemode_client.h"
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include "gamemode.h"
|
||||||
#include "common-helpers.h"
|
#include "common-helpers.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
#include "gamemode.h"
|
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -49,9 +49,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include "gamemode.h"
|
||||||
#include "common-logging.h"
|
#include "common-logging.h"
|
||||||
#include "gamemode-config.h"
|
#include "gamemode-config.h"
|
||||||
#include "gamemode.h"
|
|
||||||
|
|
||||||
#include "gamemode_client.h"
|
#include "gamemode_client.h"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user