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

Allow comments in the network list file #23

Open
numbnut opened this issue Nov 19, 2019 · 2 comments
Open

Allow comments in the network list file #23

numbnut opened this issue Nov 19, 2019 · 2 comments

Comments

@numbnut
Copy link

numbnut commented Nov 19, 2019

As I can see from the docs and the code it isn't possible to put any comments in the network list file. Especially for longer lists this is really a drawback.
Just to be clear. I'm talking about the file, which can be referenced by the network_path property.

@magnusbaeck
Copy link
Collaborator

This is a totally reasonable suggestion, but I'm not sure how we can reconcile it with the separator option. I don't know why anyone would want to configure the separator character, but if it's set to anything other than a newline character, how would comments work?

@numbnut
Copy link
Author

numbnut commented Nov 20, 2019

Hi @magnusbaeck ,
I would propose the following approach.
Only allow full line comments. Therefor inline comments are not allowed. The separator should not be allowed at the beginning of the line and the comment character is only allowed at the beginning of a line. That should lead to a simple parsing logic, which could be described the following way.

  1. Remove all lines starting with the comment character
  2. Split the remaining lines by the separator to create a list of networks

Another option would be to not allow setting separator to the same value as the comment prefix. That could be useful in any case, but would break backward compatibility.

From my point of view this should be more or less backward compatible and is easy to understand. The main question would be how the parser behaves at the moment when the line starts with a separator character. If this is actually allowed, it should be difficult to not break backward compatibility. Of course it doesn't allow inline comments, but that would be fine for me at least.
Did I miss something? Do you agree?

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

No branches or pull requests

2 participants