[PATCH v2 2/2] Introduce conf/config.dev for development

Lukas Fleischer lfleischer at archlinux.org
Tue Jun 2 01:05:57 UTC 2020


On Mon, 01 Jun 2020 at 12:50:23, Frédéric Mangano-Tarumi wrote:
> conf/config.dev\u2019s purpose is to provide a lighter configuration template
> for developers, and split development-specific options off the default
> configuration file.
> ---
>  TESTING              |  8 +++-----
>  conf/config.defaults | 10 ----------
>  conf/config.dev      | 36 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 39 insertions(+), 15 deletions(-)
>  create mode 100644 conf/config.dev

Great, thanks! A few remarks below.

> diff --git a/conf/config.dev b/conf/config.dev
> new file mode 100644
> index 00000000..e9c2112e
> --- /dev/null
> +++ b/conf/config.dev
> @@ -0,0 +1,36 @@
> +; Configuration file for aurweb development.
> +;
> +; Options are implicitly inherited from ${AUR_CONFIG}.defaults, which lists all

Saying ${AUR_CONFIG}.defaults here is elegant, short, precise and clear
to everybody who is familiar with the code base. However, given that
those comments are mainly relevant to new contributors setting up a dev
environment, I am not sure whether mentioning $AUR_CONFIG is a good idea
here (people might not be aware of what exactly it is used for at this
point). How about just saying config.defaults, given that the file is in
the same directory? While being less precise, most people should still
understand which file is referred to.

> +; available options for productions, and their default values. This current file
> +; overrides only options useful for development, and introduces
> +; development-specific options too.
> +;
> +; Paths need to be absolute, so please replace $AUR_ROOT with your project root.

Even though you added a comment is here, I am not sure that using
$AUR_ROOT below is a great idea since it is too easy to skip part of the
comment and then think that $AUR_ROOT is an actual placeholder parsed by
aurweb. I would either go back to putting a sensible default path
everywhere or replicate this comment directly above all lines containing
$AUR_ROOT.

> +
> +[database]
> +

Stray newline?

> +backend = sqlite
> +name = $AUR_ROOT/aurweb.sqlite3
> +
> +; Alternative MySQL configuration
> +;backend = mysql
> +;name = aurweb
> +;user = aur
> +;password = aur
> +
> +[options]
> +aur_location = http://127.0.0.1:8080
> +disable_http_login = 0
> +enable-maintenance = 0
> +
> +[php]
> +; Address PHP should bind when spawned in development mode by aurweb.spawn.
> +bind_address = 127.0.0.1:8081
> +; Directory containing aurweb's PHP code, required by aurweb.spawn.
> +htmldir = $AUR_ROOT/web/html
> +
> +[fastapi]
> +; Address uvicorn should bind when spawned in development mode by aurweb.spawn.
> +bind_address = 127.0.0.1:8082
> +
> +; vim: ft=dosini

I think we usually don't add modelines or any other editor-specific
configuration.


More information about the aur-dev mailing list