Skip to content

Commit

Permalink
Run fix_include checker on all source files (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnnr committed Mar 7, 2019
1 parent b9eba26 commit 35f58e5
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ci-build.py
Expand Up @@ -66,7 +66,7 @@

if args.iwyu:
# Check lexicographical order of #include directives (cheap pre-check)
sp.check_call('fix_include --dry_run --sort_only --reorder /hlwm/src/*.h', shell=True)
sp.check_call('fix_include --dry_run --sort_only --reorder /hlwm/*/*.{h,cpp,c}', shell=True, executable='bash')

# Run include-what-you-use (just printing the result for now)
sp.check_call(f'iwyu_tool -p . -j "$(nproc)" -- --mapping_file=/hlwm/.hlwm.imp', shell=True, cwd=build_dir)
Expand Down
10 changes: 5 additions & 5 deletions ipc-client/ipc-client.c
Expand Up @@ -3,18 +3,18 @@
* This software is licensed under the "Simplified BSD License".
* See LICENSE for details */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../src/ipc-protocol.h"
#include "ipc-client.h"
#include "client-utils.h"
#include "ipc-client.h"

struct HCConnection {
Display* display;
Expand Down
12 changes: 6 additions & 6 deletions ipc-client/main.c
Expand Up @@ -4,18 +4,18 @@
* See LICENSE for details */

#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <getopt.h>
#include <signal.h>
#include <regex.h>
#include <assert.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../src/ipc-protocol.h"
#include "ipc-client.h"
#include "client-utils.h"
#include "ipc-client.h"

static void print_help(char* command, FILE* file);
static void init_hook_regex(int argc, char* argv[]);
Expand Down
4 changes: 2 additions & 2 deletions src/frametree.cpp
@@ -1,14 +1,14 @@
#include "frametree.h"

#include <algorithm>

#include "client.h"
#include "ipc-protocol.h"
#include "layout.h"
#include "monitor.h"
#include "tag.h"
#include "utils.h"

#include <algorithm>

using std::endl;
using std::function;
using std::make_shared;
Expand Down
2 changes: 1 addition & 1 deletion src/hook.cpp
Expand Up @@ -4,9 +4,9 @@
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdarg.h>
#include <cassert>
#include <cstdio>
#include <stdarg.h>

#include "glib-backports.h"
#include "globals.h"
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
@@ -1,11 +1,11 @@
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <errno.h>
#include <getopt.h>
#include <sys/select.h>
#include <sys/wait.h>
#include <unistd.h>
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <cassert>
#include <csignal>
#include <cstdio>
Expand Down
6 changes: 3 additions & 3 deletions src/rules.cpp
Expand Up @@ -5,11 +5,11 @@
#include <algorithm>
#include <cstdio>

#include "globals.h"
#include "utils.h"
#include "ewmh.h"
#include "client.h"
#include "ewmh.h"
#include "globals.h"
#include "hook.h"
#include "utils.h"

using std::string;

Expand Down
2 changes: 1 addition & 1 deletion src/tag.cpp
Expand Up @@ -4,10 +4,10 @@

#include "client.h"
#include "clientmanager.h"
#include "frametree.h"
#include "globals.h"
#include "hook.h"
#include "ipc-protocol.h"
#include "frametree.h"
#include "layout.h"
#include "monitor.h"
#include "root.h"
Expand Down
6 changes: 3 additions & 3 deletions utilities/XFetchName.c
@@ -1,9 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xproto.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <stdlib.h>

#define DIE(...) do { fprintf(stderr, __VA_ARGS__); exit(1); } while(0)

Expand Down

0 comments on commit 35f58e5

Please sign in to comment.