summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rwxr-xr-xtools/linter/main.rb28
2 files changed, 1 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 85cc7a3..586f401 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ PATH := $(shell pwd)/toolchain/prefix/bin/:$(PATH)
AR = x86_64-camellia-ar
AS = x86_64-camellia-as
CC = x86_64-camellia-gcc
-CHECK = sparse
CFLAGS += -g -std=gnu99 -O2 -ftrack-macro-expansion=0
CFLAGS += -Wall -Wextra -Wold-style-definition -Werror=implicit-function-declaration
@@ -38,7 +37,7 @@ define from_sources
endef
-.PHONY: all portdeps boot lint check clean
+.PHONY: all portdeps boot check clean
all: portdeps out/boot.iso check
portdeps: out/libc.a out/libm.a src/user/lib/include/__errno.h
@@ -62,7 +61,6 @@ test: all
check: $(shell find src/kernel/ -type f -name *.c)
@echo $^ | xargs -n 1 sparse $(SPARSEFLAGS)
- @tools/linter/main.rb
clean:
rm -rf out/
diff --git a/tools/linter/main.rb b/tools/linter/main.rb
deleted file mode 100755
index 1198fd1..0000000
--- a/tools/linter/main.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env ruby
-# must be run in the root directory of the repo
-# currently it only checks if code in src/kernel/ uses anything arch-dependent
-
-$return = 0
-
-def warn(msg)
- STDERR.puts "[LINTER] #{msg}"
- $return = 1
-end
-
-whitelist = ["arch/generic.h"]
-
-Dir["src/kernel/**.?"]
- .each do |path|
- File.read(path)
- .lines
- .map(&:strip) # strip whitespace
- .filter{|line| line[0] == '#'} # find preprocessor directives
- .map{|line| line[1..].strip} # get rid of the #, strip again
- .filter{|l| l.start_with? "include"} # find includes
- .map{|l| /([<"](.+)[">])/.match(l)[2]} # get the name of the included file
- .filter{|l| l.start_with? "arch/"} # find files in arch/
- .filter{|l| not whitelist.include? l} # filter out whitelisted headers
- .each{|inc| warn "#{path} includes #{inc}"}
- end
-
-exit $return