exercism / configlet

The official tool for managing Exercism language track repositories.
https://exercism.org/docs/building/configlet
GNU Affero General Public License v3.0
22 stars 14 forks source link

fmt: improve confusing output #485

Open verdammelt opened 2 years ago

verdammelt commented 2 years ago

Version: 4.0.0-alpha.35

I ran the command configlet fmt -u -y and it repoted 58 lines of Not formatted: exercises/<path-to-exercise>/.meta/config.json followed by a single line saying Formatted the exercise config for 58 exercises.

All 58 exercises that were reported to have been "Not formatted" where in fact formatted.

Why is it reporting not formatted when in fact they are being formatted?

Full output when running this in the common-lisp track:

Found 15 Concept Exercises and 43 Practice Exercises in /Users/mark/SRC/exercism/common-lisp/config.json
Looking for exercises that lack a formatted '.meta/config.json' file...
The below paths are relative to '/Users/mark/SRC/exercism/common-lisp'
Not formatted: exercises/concept/character-study/.meta/config.json
Not formatted: exercises/concept/gigasecond-anniversary/.meta/config.json
Not formatted: exercises/concept/high-scores/.meta/config.json
Not formatted: exercises/concept/key-comparison/.meta/config.json
Not formatted: exercises/concept/larrys-winning-checker/.meta/config.json
Not formatted: exercises/concept/leslies-lists/.meta/config.json
Not formatted: exercises/concept/lillys-lasagna/.meta/config.json
Not formatted: exercises/concept/lillys-lasagna-leftovers/.meta/config.json
Not formatted: exercises/concept/log-levels/.meta/config.json
Not formatted: exercises/concept/logans-numeric-partition/.meta/config.json
Not formatted: exercises/concept/lucys-magnificent-mapper/.meta/config.json
Not formatted: exercises/concept/pal-picker/.meta/config.json
Not formatted: exercises/concept/pizza-pi/.meta/config.json
Not formatted: exercises/concept/reporting-for-duty/.meta/config.json
Not formatted: exercises/concept/socks-and-sexprs/.meta/config.json
Not formatted: exercises/practice/acronym/.meta/config.json
Not formatted: exercises/practice/all-your-base/.meta/config.json
Not formatted: exercises/practice/allergies/.meta/config.json
Not formatted: exercises/practice/anagram/.meta/config.json
Not formatted: exercises/practice/armstrong-numbers/.meta/config.json
Not formatted: exercises/practice/atbash-cipher/.meta/config.json
Not formatted: exercises/practice/beer-song/.meta/config.json
Not formatted: exercises/practice/binary/.meta/config.json
Not formatted: exercises/practice/binary-search/.meta/config.json
Not formatted: exercises/practice/bob/.meta/config.json
Not formatted: exercises/practice/collatz-conjecture/.meta/config.json
Not formatted: exercises/practice/crypto-square/.meta/config.json
Not formatted: exercises/practice/difference-of-squares/.meta/config.json
Not formatted: exercises/practice/etl/.meta/config.json
Not formatted: exercises/practice/gigasecond/.meta/config.json
Not formatted: exercises/practice/grade-school/.meta/config.json
Not formatted: exercises/practice/grains/.meta/config.json
Not formatted: exercises/practice/hamming/.meta/config.json
Not formatted: exercises/practice/hello-world/.meta/config.json
Not formatted: exercises/practice/isogram/.meta/config.json
Not formatted: exercises/practice/leap/.meta/config.json
Not formatted: exercises/practice/luhn/.meta/config.json
Not formatted: exercises/practice/meetup/.meta/config.json
Not formatted: exercises/practice/nucleotide-count/.meta/config.json
Not formatted: exercises/practice/pascals-triangle/.meta/config.json
Not formatted: exercises/practice/perfect-numbers/.meta/config.json
Not formatted: exercises/practice/phone-number/.meta/config.json
Not formatted: exercises/practice/prime-factors/.meta/config.json
Not formatted: exercises/practice/raindrops/.meta/config.json
Not formatted: exercises/practice/rna-transcription/.meta/config.json
Not formatted: exercises/practice/robot-name/.meta/config.json
Not formatted: exercises/practice/robot-simulator/.meta/config.json
Not formatted: exercises/practice/roman-numerals/.meta/config.json
Not formatted: exercises/practice/scrabble-score/.meta/config.json
Not formatted: exercises/practice/sieve/.meta/config.json
Not formatted: exercises/practice/space-age/.meta/config.json
Not formatted: exercises/practice/strain/.meta/config.json
Not formatted: exercises/practice/sublist/.meta/config.json
Not formatted: exercises/practice/triangle/.meta/config.json
Not formatted: exercises/practice/trinary/.meta/config.json
Not formatted: exercises/practice/twelve-days/.meta/config.json
Not formatted: exercises/practice/two-fer/.meta/config.json
Not formatted: exercises/practice/word-count/.meta/config.json
Formatted the exercise config for 58 exercises
ee7 commented 2 years ago

I can see that this is unclear.

It's trying to say "this file is not formatted" as it sees them, and then it formats them at the end. If you run without -y then you get a prompt saying "do you want to format the above paths?" after the final "not formatted" line. Then, if you confirm the prompt, it prints:

Formatted the exercise config for 58 exercises

verdammelt commented 2 years ago

Ah, i now understand. I'll close this issue. Thank you.

ee7 commented 2 years ago

I think the fact that you didn't understand it means that we should make it clearer.

What do you think about this?

Found 15 Concept Exercises and 43 Practice Exercises in /foo/some-track/config.json
Looking for exercises that lack a formatted '.meta/config.json' file...
The below paths are not formatted, and are relative to '/foo/some-track'
exercises/concept/character-study/.meta/config.json
exercises/concept/gigasecond-anniversary/.meta/config.json
...
Found 58 unformatted exercise configs.
Formatting exercise configs...
Formatted the exercise config for 58 exercises
verdammelt commented 2 years ago

Yes that might be clearer.

ee7 commented 2 years ago

OK - thanks. Let's track that improvement in this issue - I've reopened.