Skip to content

Commit 1d9533b

Browse files
authored
Fix linting and Makefile issues (#2)
* Add single-offset-storage method for performance In promisified mode, offsets are stored after every single message Calling into FFI is already not cheap and on top of that, the offsetsStore method does a lot of allocations because it needs to make a vector etc. etc. This method change yields a benefit of 8%. Also reduces dynamic casts by storing a reference to the rdkafka consumer. * Remove jshint and expand eslint coverage Many changes within, but only cosmetic: 1. remove jshint as it's rather unmaintained and we don't need 2 linters. 2. update eslint to latest possible version. 3. update eslint coverage to include old API and promisified tests. 4. update makefile accordingly 5. fix lint errors. * Update Makefule, update cpplint to latest version * Comply with cpplint
1 parent d776115 commit 1d9533b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3414
-2947
lines changed

.eslintrc.js

-26
This file was deleted.

.jshintignore

-2
This file was deleted.

.jshintrc

-24
This file was deleted.

Makefile

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
NODE-GYP ?= node_modules/.bin/node-gyp
22

3-
# Sick of changing this. Do a check and try to use python 2 if it doesn't work
4-
PYTHON_VERSION_FULL := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
5-
PYTHON_VERSION_MAJOR := $(word 1,${PYTHON_VERSION_FULL})
6-
7-
ifeq ($(PYTHON_VERSION_MAJOR), 2)
83
PYTHON = python
9-
else
10-
PYTHON = python2
4+
ifeq (, $(shell command -v python))
5+
PYTHON = python3
116
endif
12-
137
NODE ?= node
148
CPPLINT ?= cpplint.py
159
BUILDTYPE ?= Release
@@ -24,9 +18,7 @@ CONFIG_OUTPUTS = \
2418
build/binding.Makefile build/config.gypi
2519

2620
CPPLINT_FILES = $(wildcard src/*.cc src/*.h)
27-
CPPLINT_FILTER = -legal/copyright
28-
JSLINT_FILES = lib/*.js test/*.js e2e/*.js lib/kafkajs/*.js
29-
ESLINT_FILES = lib/kafkajs/*.js test/promisified/*.js
21+
CPPLINT_FILTER = -legal/copyright,-readability/todo,-whitespace/indent_namespace,-runtime/references
3022

3123
PACKAGE = $(shell node -pe 'require("./package.json").name.split("/")[1]')
3224
VERSION = $(shell node -pe 'require("./package.json").version')
@@ -40,16 +32,13 @@ endif
4032

4133
all: lint lib test e2e
4234

43-
lint: cpplint jslint eslint
35+
lint: cpplint eslint
4436

4537
cpplint:
4638
@$(PYTHON) $(CPPLINT) --filter=$(CPPLINT_FILTER) $(CPPLINT_FILES)
4739

48-
jslint: node_modules/.dirstamp
49-
@./node_modules/.bin/jshint --verbose $(JSLINT_FILES)
50-
5140
eslint: node_modules/.dirstamp
52-
@./node_modules/.bin/eslint $(ESLINT_FILES)
41+
@./node_modules/.bin/eslint .
5342

5443
lib: node_modules/.dirstamp $(CONFIG_OUTPUTS)
5544
@PYTHONHTTPSVERIFY=0 $(NODE-GYP) build $(GYPBUILDARGS)

0 commit comments

Comments
 (0)