Skip to content
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

lint: implement concept exercise files rule #161

Merged
merged 1 commit into from
Jan 29, 2021
Merged

Conversation

ErikSchierboom
Copy link
Member

Copy link
Member

@ee7 ee7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec says

Each concept listed in the config.json should have the following files:

concepts/<slug>/about.md
concepts/<slug>/introduction.md
concepts/<slug>/links.json

but this PR doesn't parse the config.json. Will we change the spec here?

I interpreted the previous

The Concept Exercise specific files that must be present are:

exercises/concept/<slug>/.docs/hints.md
exercises/concept/<slug>/.docs/instructions.md
exercises/concept/<slug>/.docs/introduction.md
exercises/concept/<slug>/.meta/config.json

to mean "don't parse config.json to determine the required concept exercise files, but do parse it to determine the required files for concepts".

@ErikSchierboom
Copy link
Member Author

Ah, that is definitely not an intentional difference as they should be treated the same way. There are a couple of options:

  1. Iterate over the sub-directories and check them. This has the benefit of catching any exercises that are being developed but have not yet been added to the config.json. The downside is that it is no longer possible to have any other directories in that directory, but I guess that's okay.
  2. Parse the config.json file and check based on its contents. This has the benefit that this corresponds to how things will be interpreted by the website, as it will only look at the config.json file's contents.
  3. Do a combination of the above and warn when they are out of sync. This is likely the best option, as it is not uncommon for contributors to forget to add things to the config.json file.

So in my mind, we should do option 3 so the current PR's implementation allows for that, even though it doesn't yet implement the config.json parsing.

The spec needs updating.

@ee7 ee7 marked this pull request as draft January 29, 2021 13:33
@ee7
Copy link
Member

ee7 commented Jan 29, 2021

When merging, I think you should change the commit message. It's currently

lint: implement concept exercise files rule

But this PR is about concepts, not concept exercises, right?

@ee7 ee7 marked this pull request as ready for review January 29, 2021 13:35
@ErikSchierboom ErikSchierboom merged commit 856bd46 into main Jan 29, 2021
@ErikSchierboom ErikSchierboom deleted the lint-concept-files branch January 29, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants