Skip to content

Add checksum for eslint config #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ PKG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name package.json)
SOURCE_BABEL_MD5 ?= "`./bin/md5-hash ./babel.config.js`"
BABEL_CONFIG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name babel.config.js)

# .eslintrc MD5 hash
SOURCE_ESLINT_MD5 ?= "`./bin/md5-hash ./.eslintrc`"
ESLINTRC_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name .eslintrc)

copy-assignment:
@cp package.json exercises/$(ASSIGNMENT)
@cp babel.config.js exercises/$(ASSIGNMENT)
@cp .eslintrc exercises/$(ASSIGNMENT)
@mkdir -p $(OUTDIR)
@cp exercises/grains/lib/big-integer.$(FILEEXT) $(OUTDIR)
@cp exercises/$(ASSIGNMENT)/$(TSTFILE) $(OUTDIR)
Expand All @@ -37,13 +42,18 @@ test-assignment:
@rm -rf $(OUTDIR)

test-travis:
@echo "Checking that exercise package.json files match main package.json..."
@echo "Checking that exercise package.json files match main package.json ..."
@for pkg in $(PKG_FILES); do \
! ./bin/md5-hash $$pkg | grep -qv $(SOURCE_PKG_MD5) || { echo "$$pkg does not match main package.json. Please run 'make test' locally and commit the results."; exit 1; }; \
done
@echo "Checking that exercise babel.config.js files match main babel.config.json ..."
@for bconfig in $(BABEL_CONFIG_FILES); do \
! ./bin/md5-hash $$bconfig | grep -qv $(SOURCE_BABEL_MD5) || { echo "$$bconfig does not match main babel.config.js. Please run 'make test' locally and commit the results."; exit 1; }; \
done
@echo "Checking that exercise .eslintrc files match main .eslintrc ..."
@for eslintrc in $(ESLINTRC_FILES); do \
! ./bin/md5-hash eslintrc | grep -qv $(SOURCE_ESLINT_MD5) || { echo "$$eslintrc does not match main .eslintrc. Please run 'make test' locally and commit the results."; exit 1; }; \
done
$(MAKE) -s test

test:
Expand Down