-
Notifications
You must be signed in to change notification settings - Fork 342
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
Add support for config drop-ins #997
Conversation
Dial back a little on the space requirement of the prefix for messages of levels "debug", "error" and "critical". The prefix now only includes the function name, padded to 16 characters so as to make for better vertical alignment, and the line number in the source file. Additionally updated feature test macro to make this work with recent enough versions of clang as well. config.mk: Disable warnings about empty __VA_ARGS__ Since compilation is done with '-std=gnu99' and token pasting of ',' and '__VA_ARGS__' is a GNU extension which also works with clang (>=6) this warning should be safe to disable, see also the changes to log.h above. The CI did not complain in my local tests. Only clang threw this warning before and only to inform that it is indeed a GNU extension, despite using the same '-std=gnu99'. This should not mask genuine errors when __VA_ARGS__ must not be empty, i.e. usage without token pasting it with ',', since those should be errors that lead to unsuccessful compilation, anyway.
This is basically a proof of concept, so not much official documentation just yet. Include syntax is a little more strict. The keyword is "@include", which is borrowed from doxygen. There MUST not be any blanks before the "@", like in C. Some reasoning for these preliminary decisions: Includes should stand out and thus should get some kind of special character prefix, but since '#' is already taken, they could be mistaken for comments, especially with syntax highlighting enabled. Using all capitol letters and not allowing spaces in front also serves to make them more distinguishable. Drive-by fix: Sections surrounded by spaces are no longer possible.
Also some refinements to the FILES section.
Refactoring for necessarily added complexity and push file handling into 'load_settings()', because otherwise there would be virtually no limit on how many files could be open at the same time, while we only read them sequentially, anyway.
Also reverted stripping of section names.
A more thorough check of what constitutes as *useable* and readable file.
2cb78ea
to
9cab627
Compare
Moved from settings and renamed, a small wrapper around `is_readable_file()` and `fopen()`.
Do away with the 'G_*' prefix of macros because it is misleading. The original intention was to make clear that they are derived from Glib functions but instead they might be mistaken for *actual* Glib content. Also added some more documentation for clarity.
Also fixed a double free issue with the provided path parameter. Removed leftover prototype of fopen_conf().
9cab627
to
b14ea74
Compare
Codecov Report
@@ Coverage Diff @@
## master #997 +/- ##
==========================================
+ Coverage 60.12% 60.88% +0.76%
==========================================
Files 44 44
Lines 6791 6877 +86
==========================================
+ Hits 4083 4187 +104
+ Misses 2708 2690 -18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f87a6a8
to
6189d01
Compare
6189d01
to
8c4fb45
Compare
Merged it. |
It seems that drop-ins don't work when using --config to point to the dunstrc? (the drop-ins are inside dunstrc.d which is next to the dunstrc file). |
Yeah, that could be. If you have a use case for that to be different, please open an issue about it |
This PR introduces support for drop-ins--those files (or snippets) usually residing in a *.d directory to override (some or all settings of) the main/base config in the parent directory.