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

lesson-check.py: read config.yml only once #616

Merged

Conversation

maxim-belkin
Copy link
Contributor

@maxim-belkin maxim-belkin commented Jul 12, 2021

  1. Read config.yml file only once and store the contents in a global variable CONFIG. We're currently reading this file twice.
  2. Detect lesson life cycle in the main() function instead of making check_config() function return it.
  3. Replace using_remote_theme function with a test that checks that remote_theme keyword is present in _config.yml
  4. CheckEpisode class: check method: move "remote theme test" inside the check_reference_inclusion.
  5. main: move "remote theme test" inside the read_references

1. Read `config.yml` file only once and store the contents in a global
   variable `CONFIG`. We're currently reading this file twice.
2. Detect lesson life cycle in `main` instead of making `check_config`
   return it.
3. Replace `using_remote_theme` function with a single test that checks
   that `remote_theme` keyword is present in `_config.yml`
4. CheckEpisode class: `check` method: move "remote theme test" inside the `check_reference_inclusion`.
5. main: mvoe "remote theme test" inside the `read_references`
@maxim-belkin maxim-belkin force-pushed the read-config-only-once branch from e6ef9b1 to e3808e8 Compare July 12, 2021 19:48
@maxim-belkin
Copy link
Contributor Author

All checks have passed, so merging. There should be no effect other than reading the _config.yml file only once.

@maxim-belkin maxim-belkin merged commit e1b4838 into carpentries:gh-pages Jul 13, 2021
@maxim-belkin maxim-belkin deleted the read-config-only-once branch July 13, 2021 20:22
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.

1 participant