-
Notifications
You must be signed in to change notification settings - Fork 663
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 lexer for colon-separated value config files like /etc/passwd, /etc/shadow and /etc/group #2112
Add lexer for colon-separated value config files like /etc/passwd, /etc/shadow and /etc/group #2112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if they are of much use for pygments though, so feel free to reject this PR if they are too specific.
They don't seem egregious to me, but I would prefer if they didn't match files named passwd
and shadow
.
It seems to me that they could be combined into a single lexer, with highlighting determined not by position but by content... |
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
…rated values, typically used in Unix/Linux system config files.
Thank you both for your valuable feedback. I'd appreciate if you could take another look at the changes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that I forgot to say it the first time: this PR is missing some tests. Please add them as tests/snippets/unixconfig/test-name.txt
and run pytest --update-goldens tests/snippets/unixconfig
to generate golden test output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me. Leaving this around in case @birkenfeld wants to take another look.
Thanks for the contribution! |
Hi,
I created two lexers (PasswdLexer, ShadowLexer) for lexing linux config files /etc/passwd and /etc/shadow.
I don't know if they are of much use for pygments though, so feel free to reject this PR if they are too specific.
/etc/passwd:
/etc/shadow: