diff options
author | NRK <nrk@disroot.org> | 2022-06-16 13:39:03 +0600 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2022-06-28 21:28:06 +0200 |
commit | b162aee497ef9be3730f59bb0c9d974171bfebee (patch) | |
tree | 9dd81766b59b6463cc23e698b3a8875a84e4e16c | |
parent | 6d5a04005dd1dff12ebfe2e3a56912ec26718f3f (diff) |
sort and group includes
* includes are sorted alphabetically
* their grouping and layout is the following:
- nsxiv.h will be the first include
- followed by any internal headers (e.g "commands.h" "config.h")
- followed by system headers (<stdlib.h> etc)
- followed by third party headers (X.h libwebp etc)
* also add `llvm-include-order` check to clang-tidy so that it can catch
unsorted includes during CI.
-rw-r--r-- | .woodpecker/clang-tidy-checks | 1 | ||||
-rw-r--r-- | autoreload.c | 2 | ||||
-rw-r--r-- | commands.c | 8 | ||||
-rw-r--r-- | main.c | 19 | ||||
-rw-r--r-- | nsxiv.h | 3 | ||||
-rw-r--r-- | options.c | 2 | ||||
-rw-r--r-- | util.c | 4 | ||||
-rw-r--r-- | window.c | 5 |
8 files changed, 24 insertions, 20 deletions
diff --git a/.woodpecker/clang-tidy-checks b/.woodpecker/clang-tidy-checks index 67394d4..3c6c62e 100644 --- a/.woodpecker/clang-tidy-checks +++ b/.woodpecker/clang-tidy-checks @@ -1,6 +1,7 @@ # checks clang-analyzer-*,clang-diagnostic-*,bugprone-*,performance-*,modernize-* misc-*,readability-*,android-cloexec-*,cert-* +llvm-include-order # silence -misc-unused-parameters diff --git a/autoreload.c b/autoreload.c index 47751d5..c4b5665 100644 --- a/autoreload.c +++ b/autoreload.c @@ -23,8 +23,8 @@ #include <errno.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include <sys/inotify.h> +#include <unistd.h> static union { char d[4096]; /* aligned buffer */ @@ -19,13 +19,13 @@ #include "nsxiv.h" -#include <stdlib.h> +#include "commands.h" + #include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <unistd.h> #include <sys/wait.h> - -#include "commands.h" +#include <unistd.h> extern img_t img; extern tns_t tns; @@ -22,22 +22,23 @@ #include "commands.h" #include "config.h" -#include <stdlib.h> -#include <stdarg.h> -#include <stdio.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> #include <errno.h> +#include <fcntl.h> #include <locale.h> -#include <signal.h> #include <poll.h> +#include <signal.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <sys/stat.h> +#include <sys/time.h> #include <sys/wait.h> #include <time.h> -#include <sys/time.h> -#include <X11/keysym.h> +#include <unistd.h> + #include <X11/XF86keysym.h> +#include <X11/keysym.h> #define MODMASK(mask) ((mask) & USED_MODMASK) #define BAR_SEP " " @@ -20,8 +20,9 @@ #ifndef NSXIV_H #define NSXIV_H -#include <stddef.h> #include <stdbool.h> +#include <stddef.h> + #include <Imlib2.h> #include <X11/Xlib.h> @@ -20,8 +20,8 @@ #include "nsxiv.h" #include "version.h" -#include <stdlib.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> @@ -20,13 +20,13 @@ #include "nsxiv.h" #include <assert.h> -#include <stdlib.h> +#include <errno.h> #include <stdarg.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> -#include <errno.h> const char *progname; @@ -22,13 +22,14 @@ #include "config.h" #include "icon/data.h" +#include <locale.h> #include <stdlib.h> #include <string.h> -#include <locale.h> #include <unistd.h> -#include <X11/cursorfont.h> + #include <X11/Xatom.h> #include <X11/Xresource.h> +#include <X11/cursorfont.h> #if HAVE_LIBFONTS #include "utf8.h" |