Skip to content

Commit

Permalink
Treat "generic config file" as its own language.
Browse files Browse the repository at this point in the history
This captures the '*.conf' extension, using the '#' line comment format
which is extremely common (though not universal).

The test data passes with the new config rule, but fails because the
Bitbake tests also run against the `generic_config.conf` file.
  • Loading branch information
sjjf committed Oct 9, 2024
1 parent c2699d0 commit f360c00
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@
"multi_line_comments": [["(*", "*)"]],
"extensions": ["v"]
},
"Config": {
"name": "Generic config file",
"line_comment": ["#"],
"extensions": ["conf"]
},
"Cpp": {
"name": "C++",
"line_comment": ["//"],
Expand Down
16 changes: 16 additions & 0 deletions tests/data/generic_config.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! 16 lines 10 code 4 comment 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

0 comments on commit f360c00

Please sign in to comment.