Skip to content

Commit

Permalink
Add support for nix
Browse files Browse the repository at this point in the history
  • Loading branch information
jfly authored and elijah-potter committed Oct 27, 2024
1 parent 2545411 commit df0ab61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions harper-comments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tree-sitter-toml = "0.20.0"
tree-sitter-lua = "0.0.19"
tree-sitter-bash = "0.20.0"
tree-sitter-java = "0.20.0"
tree-sitter-nix = "0.0.1"
itertools = "0.13.0"

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions harper-comments/src/comment_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl CommentParser {
"typescriptreact" => tree_sitter_typescript::language_tsx(),
"typescript" => tree_sitter_typescript::language_typescript(),
"python" => tree_sitter_python::language(),
"nix" => tree_sitter_nix::language(),
"javascript" => tree_sitter_javascript::language(),
"javascriptreact" => tree_sitter_typescript::language_tsx(),
"go" => tree_sitter_go::language(),
Expand Down Expand Up @@ -66,6 +67,7 @@ impl CommentParser {
fn filename_to_filetype(path: &Path) -> Option<&'static str> {
Some(match path.extension()?.to_str()? {
"py" => "python",
"nix" => "nix",
"rs" => "rust",
"ts" => "typescript",
"tsx" => "typescriptreact",
Expand Down

0 comments on commit df0ab61

Please sign in to comment.