Skip to content

Commit

Permalink
Deprecate deprecated exercises from problem specifications (exercism#834
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tomasnorre authored Oct 31, 2024
1 parent 8257e2b commit 9e71532
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@
"practices": [],
"prerequisites": [],
"difficulty": 1,
"status": "deprecated",
"topics": [
"extension_methods",
"sequences",
Expand Down Expand Up @@ -450,6 +451,7 @@
"practices": [],
"prerequisites": [],
"difficulty": 1,
"status": "deprecated",
"topics": [
"algorithms",
"text_formatting"
Expand All @@ -462,6 +464,7 @@
"practices": [],
"prerequisites": [],
"difficulty": 1,
"status": "deprecated",
"topics": [
"math"
]
Expand Down Expand Up @@ -717,6 +720,7 @@
"practices": [],
"prerequisites": [],
"difficulty": 1,
"status": "deprecated",
"topics": [
"math"
]
Expand Down
141 changes: 141 additions & 0 deletions contribution/checkDeprecatedExercises.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/usr/bin/env php
<?php

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",
];
}


1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
<exclude-pattern>*/*Test\.php</exclude-pattern>
<exclude-pattern>*/.meta/*\.php</exclude-pattern>
<exclude-pattern>src/*</exclude-pattern>
<exclude-pattern>contribution/*.php</exclude-pattern>
</rule>
</ruleset>

0 comments on commit 9e71532

Please sign in to comment.