aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@FreeBSD.org>2024-05-22 13:57:17 +0000
committerDave Cottlehuber <dch@FreeBSD.org>2024-05-22 13:57:17 +0000
commit5c23643be7e87f18150e95fcd66dfc1891972309 (patch)
treeec29172fcca5ece31302abf3b5d994709e48c75f
parent969cda56e5bef5072cbf3fee549888f5051ed987 (diff)
downloadports-5c23643be7e87f18150e95fcd66dfc1891972309.tar.gz
ports-5c23643be7e87f18150e95fcd66dfc1891972309.zip
textproc/py-grep-ast: new port - grep AST of source files
-rw-r--r--textproc/Makefile1
-rw-r--r--textproc/py-grep-ast/Makefile33
-rw-r--r--textproc/py-grep-ast/distinfo3
-rw-r--r--textproc/py-grep-ast/pkg-descr12
4 files changed, 49 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile
index fc1d4d6774f7..505f3ddb7225 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1376,6 +1376,7 @@
SUBDIR += py-gensim
SUBDIR += py-gi-docgen
SUBDIR += py-grapheme
+ SUBDIR += py-grep-ast
SUBDIR += py-griffe
SUBDIR += py-guess-language
SUBDIR += py-hashids
diff --git a/textproc/py-grep-ast/Makefile b/textproc/py-grep-ast/Makefile
new file mode 100644
index 000000000000..a78043b63882
--- /dev/null
+++ b/textproc/py-grep-ast/Makefile
@@ -0,0 +1,33 @@
+PORTNAME= grep-ast
+DISTVERSION= 0.3.2
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= grep_ast-${PORTVERSION}
+
+MAINTAINER= dch@FreeBSD.org
+COMMENT= Pythonic grep through AST of source files
+WWW= https://github.com/paul-gauthier/grep-ast
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pathspec>=0:devel/py-pathspec@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}tree-sitter-languages>0:devel/py-tree-sitter-languages@${PY_FLAVOR}
+
+USES= python shebangfix
+USE_PYTHON= autoplist concurrent distutils
+
+NO_ARCH= yes
+
+PORTDOCS= README.md
+
+OPTIONS_DEFINE= DOCS
+
+post-install-DOCS-on:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} \
+ ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/textproc/py-grep-ast/distinfo b/textproc/py-grep-ast/distinfo
new file mode 100644
index 000000000000..76296c149aa1
--- /dev/null
+++ b/textproc/py-grep-ast/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1716362443
+SHA256 (grep_ast-0.3.2.tar.gz) = d53bc7d25dfefafe77643fec189ab38e3cbd839d546c070a950ebedad82ee164
+SIZE (grep_ast-0.3.2.tar.gz) = 11143
diff --git a/textproc/py-grep-ast/pkg-descr b/textproc/py-grep-ast/pkg-descr
new file mode 100644
index 000000000000..96568918b5e2
--- /dev/null
+++ b/textproc/py-grep-ast/pkg-descr
@@ -0,0 +1,12 @@
+Grep source code files and see matching lines with useful context that
+show how they fit into the code. See the loops, functions, methods,
+classes, etc that contain all the matching lines. Get a sense of what's
+inside a matched class or function definition. You see relevant code from
+every layer of the abstract syntax tree, above and below the matches.
+
+By default, grep-AST recurses the current directory to search all source
+code files. It respects .gitignore, so it will usually "do the right
+thing" in most repos if you just do grep-ast <regex> without specifying
+any filenames.
+
+You can also invoke grep-ast as gast for convenience.