question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

default.cfg isn't documented

See original GitHub issue

Now that #98 has been merged it has replaced the temporary dirs.py I added exactly like I had envisioned that happening. So now it’s time to open this issue on one last improvement on that front I’d like to see.

See, both dirs.py and default.cfg had/have this one issue, that’s most relevant to devs, but not irrelevant to standard users either. When default.cfg is edited, Git will recognize this as a change that might be uploaded to the repo, which of course isn’t ever the case. While this can easily be ignored locally, switching branches will overwrite the default.cfg. Further if we ever change the default.cfg, which we should do as rarely as possible but let’s be real, it will probably happen a few times, this also would overwrite any custom changes by the user, and this last point is also what’s affecting all users, not just devs.

The question is, what do we actually do about that? I’ve thought about it for a while but I’m not entirely sure what’s the best approach. The best idea I had involves versioning and is this:

  1. Rename default.cfg to [version].cfg and add internal cfg versioning
  2. Add default.cfg to .gitignore (which btw still contains a reference to media_dir.txt we can delete with the same PR)
  3. References still look for a default.cfg, and if it’s not found will offer to rename [version].cfg into default.cfg, making sure that hassle for end users is kept to an absolute minimum
  4. At this stage the user only needs to get a default.cfg once which can be automatically done on the CLI, after which that default.cfg interferes neither with dev work like branch switching, nor will it ever be overwritten by updates. Necessary updates instead include a [newer version].cfg and will throw a warning/error at users, informing them of the need to migrate their changes to the newer version.

Thoughts are any issues with this plan?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
leotrscommented, Jul 7, 2020

My next step in terms of the config system is definitely a more extensive documentation. I like your idea of also leaving a comment inside default.cfg. Some thing like DO NOT EDIT THIS FILE. USE <such and such> FILE INSTEAD.

This already works just fine on windows though

That’s what I thought, I just hadn’t tested it yet.

0reactions
leotrscommented, Aug 26, 2020

I’m closing this as there now exists a file documenting the config system in docs/build/tutorials/configuration.html. This file is far from complete, but at least it explains the cascading system, which is the subject of this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

config file is not mentioned in readme #855 - Jguer/yay - GitHub
Issue. I can not find "config" with ctrl + f from readme on GitHub. Suggest. Improve documentation to mention default config file location ......
Read more >
Aruba 7220 stuck reading default.cfg | Wireless Access
I have an Aruba 7220 controller which is getting stuck saying "Reading configuration from default.cfg" - it gets no further after several minutes/hours...
Read more >
How do you have a default #[cfg] target in rust for 'everything ...
The #[cfg] helper is pretty obscure, and not particularly well documented, but by digging through librustc I've got a pretty reasonable list ...
Read more >
What do I do if I get the error "Failed to read default.cfg" when ...
The first step to resolve this issue is to verify your game files to ensure all of the games files are now being...
Read more >
detectron2.config
CfgNode , but different in: Use unsafe yaml loading by default. Note that this may lead to arbitrary code execution: you must not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found