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

learn: Update and refactor naming #374

Merged
merged 4 commits into from
Jun 6, 2024
Merged

learn: Update and refactor naming #374

merged 4 commits into from
Jun 6, 2024

Conversation

juliaogris
Copy link
Member

@juliaogris juliaogris commented Jun 5, 2024

This is another carved-off refactoring PR in order to make
directory exporting and exercises modelling more reviewable
in a follow-up commit.

Refactors:

  • Rename question package to learn
  • Rename Model to QuestionModel(in anticipation ofExerciseModel, UnitModel` etc.)
  • Change --unsealed-only flag to --ignore-sealed
  • Add a learn.go file as entrypoint to the learn package with errors

Move question package to learn package as this seems the increasingly more
suitable name, maybe we will even move it to the top-level /pkg directory.
This change was prompted when renaming Model to QuesitonModel caused stutter
linter warning some commits ahead.
Refactor question model to be explicitly called QuestionModel so we can free
up the model model for an interface type.
Add learn.go file to package learn as entry point containing errors and
package godocs. This is to follow the convention of using packagename.go as a
starting point when reading the source code of a package.
@juliaogris juliaogris changed the title learn: Add directory exporting and model exercises learn: Update and refactor naming Jun 5, 2024
Copy link
Member

@camh- camh- left a comment

Choose a reason for hiding this comment

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

🥬 LGTM

learn/pkg/learn/question_test.go Outdated Show resolved Hide resolved
Refactor --unsealed-only into --ignore-sealed flag, which allows us to export
unmarked and unverified sealed questions to HTML. Solution marking and
answerkey additions are skipped if --ignore-sealed is set. This "ignore"
seems to better reflect what's actually going on.

While at it pull functional options in learn package out into their own file.
We will add a few more and reuse them for the ExerciseModel soon.
@juliaogris juliaogris merged commit e60be1b into main Jun 6, 2024
3 checks passed
@juliaogris juliaogris deleted the learn-export branch June 6, 2024 00:10
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