From 984ddadfe71f839f55e1a5149b8838a71c07d878 Mon Sep 17 00:00:00 2001 From: Simon Fowler Date: Mon, 29 May 2023 22:05:20 +1000 Subject: [PATCH] Treat "generic config file" as its own language. This captures the '*.conf' extension, using the '#' line comment format which is extremely common (though not universal). --- languages.json | 5 +++++ tests/data/generic_config.conf | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/data/generic_config.conf diff --git a/languages.json b/languages.json index 13685b9fa..3f829f03a 100644 --- a/languages.json +++ b/languages.json @@ -623,6 +623,11 @@ ], "extensions": ["gd"] }, + "GenericConfig": { + "name": "Generic config", + "line_comment": ["#"], + "extensions": ["conf"] + }, "Gherkin": { "name": "Gherkin (Cucumber)", "line_comment": ["#"], diff --git a/tests/data/generic_config.conf b/tests/data/generic_config.conf new file mode 100644 index 000000000..f0dd25742 --- /dev/null +++ b/tests/data/generic_config.conf @@ -0,0 +1,16 @@ +# 16 lines 10 code 4 comments 2 blanks +# This is a comment +this=not_a_comment +[this_is_a_section] +and this is not a comment either + +# Why is it so hard to create a random file like this? +foo=bar +bar=baz + +## Tricksy comments! +more +lines +that +are +not comments