willkg / douglas

DEAD PROJECT: File based static rendering blog system
Other
2 stars 3 forks source link

woah nelly--fix configuration #31

Open willkg opened 10 years ago

willkg commented 10 years ago

Configuration is crazy:

  1. defaults are all over the code base
  2. there's no config value validation
  3. there's no critical mass of config options that are guaranteed to exist
  4. the documentation is spotty and inconsistent and in multiple places

I think the best thing to do here is to create a config module which imports the config, validates it (or dies), allows you to have configuration defaults and documentation to be in one place, and guarantees the rest of the codebase that certain config options exist.

This is probably a non-trivial project. The first step is probably to write validation code that scolds people when configuration values are not valid and requires certain configuration values to exist.

Examples:

  1. which things need to end in a / ?
  2. which things need to have a / at front?
  3. which are file paths? url paths?
  4. which are numbers?
  5. which are booleans?
  6. which are missing?
willkg commented 10 years ago

This is half done in 4799c3d. There's still a bunch to do: