aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy14
-rw-r--r--.travis.yml4
-rw-r--r--nnn.c1
-rw-r--r--nnn.h4
4 files changed, 22 insertions, 1 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..82b705e
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,14 @@
+---
+Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,-misc-unused-parameters,google-runtime-int,-llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*,-readability-magic-numbers,-readability-braces-around-statements'
+WarningsAsErrors: '*'
+HeaderFilterRegex: '.*(?<!lookup3.c)$'
+FormatStyle: 'file'
+CheckOptions:
+ - key: readability-braces-around-statements.ShortStatementLines
+ value: '1'
+ - key: google-runtime-int.TypeSufix
+ value: '_t'
+ - key: fuchsia-restrict-system-includes.Includes
+ value: '*,-stdint.h,-stdbool.h'
+
+...
diff --git a/.travis.yml b/.travis.yml
index 13f85f2..31c2dc0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,10 +20,14 @@ matrix:
- os: osx
compiler: clang
+install:
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$CC" == "clang" ]]; then brew update; brew install llvm; export PATH="/usr/local/opt/llvm/bin:$PATH"; fi; fi
+
script:
- export CFLAGS=-Werror;
- make clean; make;
- make clean;
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$CC" == "clang" ]]; then clang-tidy *.h *.c -- -I/usr/include; fi; fi
before_deploy:
- cd ..
diff --git a/nnn.c b/nnn.c
index dfb7b71..2cb62ff 100644
--- a/nnn.c
+++ b/nnn.c
@@ -64,7 +64,6 @@
#ifndef __USE_XOPEN /* Fix failure due to wcswidth(), ncursesw/curses.h includes whcar.h on Ubuntu 14.04 */
#define __USE_XOPEN
#endif
-#include <curses.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/nnn.h b/nnn.h
index 07d6774..cb3b346 100644
--- a/nnn.h
+++ b/nnn.h
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#pragma once
+
+#include <curses.h>
+
#define CONTROL(c) ((c) ^ 0x40)
/* Supported actions */