From 57d55d46ff2b362bdd257195b5956188a5e55083 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Thu, 31 Oct 2024 09:28:45 +0100 Subject: [PATCH 1/2] Deprecate deprecated exercises from problem specifications --- bin/checkDeprecatedExercises.php | 162 +++++++++++++++++++++++++++++++ config.json | 4 + 2 files changed, 166 insertions(+) create mode 100644 bin/checkDeprecatedExercises.php diff --git a/bin/checkDeprecatedExercises.php b/bin/checkDeprecatedExercises.php new file mode 100644 index 00000000..3ae9e69e --- /dev/null +++ b/bin/checkDeprecatedExercises.php @@ -0,0 +1,162 @@ +. + * + * To disable strict typing, comment out the directive below. + */ + +declare(strict_types=1); + +$deprecatedExercises = []; +foreach (getExercises() as $exercise) { + $headerResponse = get_headers("https://github.com/exercism/problem-specifications/blob/main/exercises/{$exercise}/.deprecated")[0]; + if (!str_contains($headerResponse, '200 OK')) { + continue; + } + + $deprecatedExercises[] = $exercise; +} + +var_dump($deprecatedExercises); + +function getExercises(): array +{ + return [ + "annalyns-infiltration", + "city-office", + "language-list", + "lasagna", + "lucky-numbers", + "pizza-pi", + "sweethearts", + "windowing-system", + "accumulate", + "acronym", + "affine-cipher", + "allergies", + "all-your-base", + "alphametics", + "anagram", + "armstrong-numbers", + "atbash-cipher", + "bank-account", + "beer-song", + "binary", + "binary-search", + "binary-search-tree", + "bob", + "book-store", + "bowling", + "change", + "circular-buffer", + "clock", + "collatz-conjecture", + "connect", + "crypto-square", + "custom-set", + "darts", + "diamond", + "difference-of-squares", + "dnd-character", + "eliuds-eggs", + "etl", + "flatten-array", + "food-chain", + "gigasecond", + "grade-school", + "grains", + "hamming", + "hello-world", + "high-scores", + "house", + "isbn-verifier", + "isogram", + "killer-sudoku-helper", + "kindergarten-garden", + "knapsack", + "largest-series-product", + "leap", + "linked-list", + "list-ops", + "luhn", + "markdown", + "mask-credit-card", + "matching-brackets", + "matrix", + "meetup", + "micro-blog", + "minesweeper", + "nth-prime", + "nucleotide-count", + "ocr-numbers", + "ordinal-number", + "palindrome-products", + "pangram", + "parallel-letter-frequency", + "pascals-triangle", + "perfect-numbers", + "phone-number", + "pig-latin", + "poker", + "prime-factors", + "protein-translation", + "proverb", + "queen-attack", + "rail-fence-cipher", + "raindrops", + "resistor-color", + "resistor-color-duo", + "resistor-color-trio", + "reverse-string", + "rna-transcription", + "robot-name", + "robot-simulator", + "roman-numerals", + "rotational-cipher", + "run-length-encoding", + "say", + "scale-generator", + "scrabble-score", + "secret-handshake", + "series", + "sieve", + "simple-cipher", + "space-age", + "spiral-matrix", + "state-of-tic-tac-toe", + "strain", + "sublist", + "sum-of-multiples", + "tournament", + "transpose", + "triangle", + "trinary", + "twelve-days", + "two-bucket", + "two-fer", + "variable-length-quantity", + "word-count", + "wordy", + "yacht", + "zebra-puzzle", + ]; +} + + diff --git a/config.json b/config.json index dc9c9e54..b781abbe 100644 --- a/config.json +++ b/config.json @@ -389,6 +389,7 @@ "practices": [], "prerequisites": [], "difficulty": 1, + "status": "deprecated", "topics": [ "extension_methods", "sequences", @@ -450,6 +451,7 @@ "practices": [], "prerequisites": [], "difficulty": 1, + "status": "deprecated", "topics": [ "algorithms", "text_formatting" @@ -462,6 +464,7 @@ "practices": [], "prerequisites": [], "difficulty": 1, + "status": "deprecated", "topics": [ "math" ] @@ -717,6 +720,7 @@ "practices": [], "prerequisites": [], "difficulty": 1, + "status": "deprecated", "topics": [ "math" ] From 6ac399e715be6a8a0daad68ee29b0ee4f3424cb0 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Thu, 31 Oct 2024 13:35:18 +0100 Subject: [PATCH 2/2] Update location of checkDeprecatedExercises.php --- .../checkDeprecatedExercises.php | 23 +------------------ phpcs.xml | 1 + 2 files changed, 2 insertions(+), 22 deletions(-) rename {bin => contribution}/checkDeprecatedExercises.php (77%) mode change 100644 => 100755 diff --git a/bin/checkDeprecatedExercises.php b/contribution/checkDeprecatedExercises.php old mode 100644 new mode 100755 similarity index 77% rename from bin/checkDeprecatedExercises.php rename to contribution/checkDeprecatedExercises.php index 3ae9e69e..3b11c099 --- a/bin/checkDeprecatedExercises.php +++ b/contribution/checkDeprecatedExercises.php @@ -1,27 +1,6 @@ +#!/usr/bin/env php . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); $deprecatedExercises = []; diff --git a/phpcs.xml b/phpcs.xml index 8c701492..b31d1cf6 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -48,5 +48,6 @@ */*Test\.php */.meta/*\.php src/* + contribution/*.php