From e746ca02cbc62c082e3f9ca06af9d3d29bdcf06b Mon Sep 17 00:00:00 2001 From: BrianDGLS Date: Fri, 22 Sep 2017 15:55:03 +0100 Subject: [PATCH 1/2] added exercise stubs --- exercises/anagram/anagram.ts | 0 exercises/beer-song/beer-song.ts | 0 exercises/bob/bob.ts | 0 exercises/difference-of-squares/difference-of-squares.ts | 0 exercises/etl/etl.ts | 0 exercises/food-chain/food-chain.ts | 0 exercises/gigasecond/gigasecond.ts | 0 exercises/grade-school/grade-school.ts | 0 exercises/hamming/hamming.ts | 0 exercises/hello-world/hello-world.ts | 0 exercises/leap/leap.ts | 0 exercises/pangram/pangram.ts | 0 exercises/phone-number/phone-number.ts | 0 exercises/raindrops/raindrops.ts | 0 exercises/rna-transcription/rna-transcription.ts | 0 exercises/robot-name/robot-name.ts | 0 exercises/say/say.ts | 0 exercises/scrabble-score/scrabble-score.ts | 0 exercises/space-age/space-age.ts | 0 exercises/word-count/word-count.ts | 0 exercises/wordy/wordy.ts | 0 21 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 exercises/anagram/anagram.ts create mode 100644 exercises/beer-song/beer-song.ts create mode 100644 exercises/bob/bob.ts create mode 100644 exercises/difference-of-squares/difference-of-squares.ts create mode 100644 exercises/etl/etl.ts create mode 100644 exercises/food-chain/food-chain.ts create mode 100644 exercises/gigasecond/gigasecond.ts create mode 100644 exercises/grade-school/grade-school.ts create mode 100644 exercises/hamming/hamming.ts create mode 100644 exercises/hello-world/hello-world.ts create mode 100644 exercises/leap/leap.ts create mode 100644 exercises/pangram/pangram.ts create mode 100644 exercises/phone-number/phone-number.ts create mode 100644 exercises/raindrops/raindrops.ts create mode 100644 exercises/rna-transcription/rna-transcription.ts create mode 100644 exercises/robot-name/robot-name.ts create mode 100644 exercises/say/say.ts create mode 100644 exercises/scrabble-score/scrabble-score.ts create mode 100644 exercises/space-age/space-age.ts create mode 100644 exercises/word-count/word-count.ts create mode 100644 exercises/wordy/wordy.ts diff --git a/exercises/anagram/anagram.ts b/exercises/anagram/anagram.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/beer-song/beer-song.ts b/exercises/beer-song/beer-song.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/bob/bob.ts b/exercises/bob/bob.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/difference-of-squares/difference-of-squares.ts b/exercises/difference-of-squares/difference-of-squares.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/etl/etl.ts b/exercises/etl/etl.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/food-chain/food-chain.ts b/exercises/food-chain/food-chain.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/gigasecond/gigasecond.ts b/exercises/gigasecond/gigasecond.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/grade-school/grade-school.ts b/exercises/grade-school/grade-school.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/hamming/hamming.ts b/exercises/hamming/hamming.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/hello-world/hello-world.ts b/exercises/hello-world/hello-world.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/leap/leap.ts b/exercises/leap/leap.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/pangram/pangram.ts b/exercises/pangram/pangram.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/phone-number/phone-number.ts b/exercises/phone-number/phone-number.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/raindrops/raindrops.ts b/exercises/raindrops/raindrops.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/rna-transcription/rna-transcription.ts b/exercises/rna-transcription/rna-transcription.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/robot-name/robot-name.ts b/exercises/robot-name/robot-name.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/say/say.ts b/exercises/say/say.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/scrabble-score/scrabble-score.ts b/exercises/scrabble-score/scrabble-score.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/space-age/space-age.ts b/exercises/space-age/space-age.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/word-count/word-count.ts b/exercises/word-count/word-count.ts new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/wordy/wordy.ts b/exercises/wordy/wordy.ts new file mode 100644 index 000000000..e69de29bb From ff4dcfdc81c3d907f3039aa95193a18ab6164faf Mon Sep 17 00:00:00 2001 From: BrianDGLS Date: Fri, 22 Sep 2017 16:18:56 +0100 Subject: [PATCH 2/2] added test to check for stub file --- Makefile | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f9235f7b4..696f664e0 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,11 @@ test-assignment: test: $(MAKE) checkAllPackageFilesAreTheSame + $(MAKE) checkAllExercisesHaveStubFile @npm install tslint typescript -g @tslint './**/*.ts?(x)' -c "./common/tslint.json" --format "json" >> lintreport.json ; exit 0 @for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) test-assignment || exit 1; done - + all: moveAllIntoCommonDir all: moveCommonIntoSubDir @@ -44,7 +45,7 @@ moveAllIntoCommonDir: moveCommonIntoSubDir: @for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) moveAssigmentToSub || exit 1; done - + all: replacePackageFilesFromCommonToSubFolders copyPackageFilesToSubFolder: @@ -67,9 +68,19 @@ checkPackageFilesMach: reportError: @echo "**Package files in |$(ASSIGNMENT)| are not equal to the |common| folder**" ; @exit 1 - + checkAllPackageFilesAreTheSame: - @for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) checkPackageFilesMach || ASSIGNMENT=$$assignment $(MAKE) reportError || exit 1 ;done + @for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) checkPackageFilesMach || ASSIGNMENT=$$assignment $(MAKE) reportError || exit 1 ;done @echo "==All package support files look to be the same as the ones in common==" +reportNoStubFile: + @echo "**Exercise |$(ASSIGNMENT)| does contain a stub file**" ; + @exit 1 + +checkStubFileExists: + [ -f ./exercises/$(ASSIGNMENT)/$(ASSIGNMENT).ts ] || exit 1; + +checkAllExercisesHaveStubFile: + @for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) checkStubFileExists || ASSIGNMENT=$$assignment $(MAKE) reportNoStubFile || exit 1 ;done + @echo "==All exercises should contain a stub file with the exercise name=="