Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
adfaure committed Dec 3, 2024
1 parent 1cd6f29 commit 485f437
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
35 changes: 8 additions & 27 deletions pkgs/development/python-modules/tree-sitter-grammars/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
lib,
buildPythonPackage,
pytestCheckHook,
tree-sitter,
symlinkJoin,
writeTextDir,
pythonOlder,
# `name`: grammar derivation pname in the format of `tree-sitter-<lang>`
name,
grammarDrv,
}:
{ lib, buildPythonPackage, pytestCheckHook, tree-sitter, symlinkJoin
, writeTextDir, pythonOlder,
# `name`: grammar derivation pname in the format of `tree-sitter-<lang>`
name, grammarDrv, }:
let
inherit (grammarDrv) version;

Expand All @@ -18,12 +10,9 @@ let
# If the name of the grammar attribute differs from the grammar's symbol name,
# it could cause a symbol mismatch at load time. This override ensures the binding can
# find the correct symbol
langIdentOverrides = {
tree_sitter_org_nvim = "tree_sitter_org";
};
langIdentOverrides = { tree_sitter_org_nvim = "tree_sitter_org"; };
langIdent = langIdentOverrides.${snakeCaseName} or snakeCaseName;
in
buildPythonPackage {
in buildPythonPackage {
inherit version;
pname = drvPrefix;

Expand Down Expand Up @@ -143,20 +132,12 @@ buildPythonPackage {

disabled = pythonOlder "3.8";

nativeCheckInputs = [
tree-sitter
pytestCheckHook
];
nativeCheckInputs = [ tree-sitter pytestCheckHook ];
pythonImportsCheck = [ snakeCaseName ];

meta = {
description = "Python bindings for ${name}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
a-jay98
adfaure
mightyiam
stepbrobd
];
maintainers = with lib.maintainers; [ a-jay98 adfaure mightyiam stepbrobd ];
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ lib }:
{
{ lib }: {
tree-sitter-bash = lib.importJSON ./tree-sitter-bash.json;
tree-sitter-beancount = lib.importJSON ./tree-sitter-beancount.json;
tree-sitter-bibtex = lib.importJSON ./tree-sitter-bibtex.json;
Expand All @@ -24,7 +23,8 @@
tree-sitter-elisp = lib.importJSON ./tree-sitter-elisp.json;
tree-sitter-elixir = lib.importJSON ./tree-sitter-elixir.json;
tree-sitter-elm = lib.importJSON ./tree-sitter-elm.json;
tree-sitter-embedded-template = lib.importJSON ./tree-sitter-embedded-template.json;
tree-sitter-embedded-template =
lib.importJSON ./tree-sitter-embedded-template.json;
tree-sitter-erlang = lib.importJSON ./tree-sitter-erlang.json;
tree-sitter-fennel = lib.importJSON ./tree-sitter-fennel.json;
tree-sitter-fish = lib.importJSON ./tree-sitter-fish.json;
Expand Down

0 comments on commit 485f437

Please sign in to comment.