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

Bitbake rules match all '*.conf' files. #1000

Open
sjjf opened this issue May 29, 2023 · 4 comments
Open

Bitbake rules match all '*.conf' files. #1000

sjjf opened this issue May 29, 2023 · 4 comments

Comments

@sjjf
Copy link

sjjf commented May 29, 2023

I'm not sure what the correct way to handle *.conf files is, but it seems unlikely that assigning them all to the Bitbake language is the appropriate choice.

This rule was added with commit da0841d from August 2022. I assume the fix would be something like:

diff --git a/languages.json b/languages.json
index 1a93115..9627450 100644
--- a/languages.json
+++ b/languages.json
@@ -150,7 +150,7 @@
       "name": "Bitbake",
       "line_comment": ["#"],
       "quotes": [["\\\"", "\\\""], ["'", "'"]],
-      "extensions": ["bb", "bbclass", "bbappend", "inc", "conf"]
+      "extensions": ["bb", "bbclass", "bbappend", "inc"]
     },
     "BrightScript": {
       "quotes": [["\\\"", "\\\""]],
@sjjf
Copy link
Author

sjjf commented May 29, 2023

I'm happy to make a pull request with that change, but for an 8 character change that seems a bit over the top . . .

@XAMPPRocky
Copy link
Owner

Thank you for your issue! Seems like an appropriate step to take for now. Can I ask what language are you using in your project that uses the conf extension?

All PRs large and small are welcome and appreciated :)

@sjjf
Copy link
Author

sjjf commented May 29, 2023

This is a puppet environment - it's got a whole bunch of files of various types, including templates for config files in at least ten different formats, and plain config files in another ten different formats.

I don't know if a generic "config file" language config would be viable, there are probably some reasonable assumptions you could make ('#' or ';' for line comments would probably work for the majority of what you might call generic *.conf files), but they'd be necessarily broad . . . But it's pretty obvious to me that no specific language should lay claim to the .conf extension - that way lies madness.

PR submitted, #1001 - I didn't see anything in the contributors doco about sign off or anything like that, if I missed something let me know and I'll fix it.

@sjjf
Copy link
Author

sjjf commented May 29, 2023

Yeah, five minutes looking through /etc on my local Linux machine showed 95%+ using the '#' line comment format, as you'd expect . . . aside from a bunch of XML files masquerading as "*.conf" files (gconf and fontconfig being the culprits there).

I /think/ that would be something like:

diff --git a/languages.json b/languages.json
index 9627450..0614431 100644
--- a/languages.json
+++ b/languages.json
@@ -247,6 +247,11 @@
       "multi_line_comments": [["(*", "*)"]],
       "extensions": ["v"]
     },
+    "Config": {
+        "name": "Generic config file",
+        "line_comment": ["#"],
+        "extensions": ["conf"]
+    },
     "Cpp": {
       "name": "C++",
       "line_comment": ["//"],

Though that might be claiming more than it should, if the only option for deciding what language rule to match is the extension then that's probably the best it could do.

I just submitted a PR with that, #1002.

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