• Stars
    star
    123
  • Rank 290,217 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 6 years ago
  • Updated 16 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A parallel universal-ctags wrapper for git repository

ptags

A parallel universal-ctags wrapper for git repository

Actions Status Crates.io codecov

Description

ptags is a universal-ctags wrapper to have the following features.

  • Search git tracked files only ( .gitignore support )
  • Call ctags command in parallel for acceleration
    • Up to x5 faster than universal-ctags

Install

Download binary

Download from release page, and extract to the directory in PATH.

Arch Linux

You can install from AUR.

If you use yay, you can install like below:

yay -S ptags       // latest tagged version
yay -S ptags-git   // current master of git repo

Cargo

You can install by cargo.

cargo install ptags

Requirement

ptags uses ctags and git command internally. The tested version is below.

Command Version
ctags Universal Ctags 0.0.0(f9e6e3c1) / Exuberant Ctags 5.8
git git version 2.14.2
git-lfs git-lfs/2.3.3

Usage

ptags 0.1.12-pre
[email protected]
A parallel universal-ctags wrapper for git repository

USAGE:
    ptags [FLAGS] [OPTIONS] [--] [DIR]

FLAGS:
        --config               Generate configuration sample file
        --exclude-lfs          Exclude git-lfs tracked files
    -h, --help                 Prints help information
        --include-ignored      Include ignored files
        --include-submodule    Include submodule files
        --include-untracked    Include untracked files
    -s, --stat                 Show statistics
        --unsorted             Disable tags sort
        --validate-utf8        Validate UTF8 sequence of tag file
    -V, --version              Prints version information
    -v, --verbose              Verbose mode

OPTIONS:
        --bin-ctags <bin_ctags>           Path to ctags binary [default: ctags]
        --bin-git <bin_git>               Path to git binary [default: git]
        --completion <completion>         Generate shell completion file [possible values: bash, fish,
                                          zsh, powershell]
    -e, --exclude <exclude>...            Glob pattern of exclude file ( ex. --exclude '*.rs' )
    -c, --opt-ctags <opt_ctags>...        Options passed to ctags
    -g, --opt-git <opt_git>...            Options passed to git
        --opt-git-lfs <opt_git_lfs>...    Options passed to git-lfs
    -f, --file <output>                   Output filename ( filename '-' means output to stdout ) [default: tags]
    -t, --thread <thread>                 Number of threads [default: 8]

ARGS:
    <DIR>    Search directory [default: .]

You can pass options to ctags by-c/--ctags_opt option like below.

ptags -c --links=no -c --languages=Rust

Searched file types per options are below. --include-submodule and --include_untracked are exclusive. This is the restriction of git ls-files. Any include/exclude options without the above combination can be used simultaneously.

File type Default --exclude-lfs --include-ignored --include-submodule --include-untracked
tracked o o o o o
untracked x x x x o
ignored x x o x x
lfs tracked o x o o o
in submodules x x x o x

You can override any default option by ~/.ptags.toml like below. The complete example of ~/.ptags.toml can be generated by --config option.

thread = 16
bin_ctags = "ctags2"
bin_git = "git2"

Benchmark

Environment

  • CPU: Ryzen Threadripper 1950X
  • MEM: 128GB
  • OS : CentOS 7.4.1708

Data

Name Repository Revision Files Size[GB]
source0 https://github.com/neovim/neovim f5b0f5e17 2370 0.1
source1 https://github.com/llvm-mirror/llvm ddf9edb4020 29670 1.2
source2 https://github.com/torvalds/linux 071e31e254e0 52998 2.2
source3 https://github.com/chromium/chromium d79c68510b7e 293205 13

Result

ptags is up to x5 faster than universal-ctags.

Command Version source0 source1 source2 source3
ctags -R Universal Ctags 0.0.0(f9e6e3c1) 0.41s ( x1 ) 3.42s ( x1 ) 23.64s ( x1 ) 32.23 ( x1 )
ptags -t 16 ptags 0.1.4 0.13s ( x3.15 ) 0.58s ( x5.90 ) 4.24s ( x5.58 ) 7.27s ( x4.43 )

More Repositories

1

procs

A modern replacement for ps written in Rust
Rust
5,092
star
2

amber

A code search / replace tool
Rust
832
star
3

svls

SystemVerilog language server
Rust
461
star
4

sv-parser

SystemVerilog parser library fully compliant with IEEE 1800-2017
Rust
403
star
5

svlint

SystemVerilog linter
Rust
309
star
6

veryl

Veryl: A Modern Hardware Description Language
Rust
226
star
7

termbg

A Rust library for terminal background color detection
Rust
86
star
8

D2dControl

WPF Control for Direct2D with SharpDX
C#
82
star
9

pipecolor

A terminal filter to colorize output
Rust
63
star
10

nom-tracable

Extension of nom to trace parser
Rust
48
star
11

prosafe_exporter

Prometheus exporter for NETGEAR switches supported by ProSAFE Plus utility
Rust
44
star
12

gip

a command-line tool to get global IP address
Rust
35
star
13

softether_exporter

Prometheus Exporter of SoftEther VPN Server
Rust
33
star
14

cargo-trend

Cargo subcommand to generate trend graph of dependent crates
Rust
31
star
15

flexlint

A flexible linter with rules defined by regular expression
Rust
28
star
16

structopt-toml

An default value loader from TOML for structopt
Rust
28
star
17

nom-packrat

Extension of nom to apply "Packrat Parsing"
Rust
21
star
18

svls-vscode

SystemVerilog language server client for Visual Studio Code
TypeScript
20
star
19

fts-rs

A Rust library for high performance directory walking using libc fts.
Rust
18
star
20

nom-recursive

Extension of nom to handle left recursion
Rust
16
star
21

mdbook-transcheck

Checker for translated mdbook
Rust
16
star
22

git-skel

A git subcommand to apply skeleton repository continuously
Rust
12
star
23

sdcx

Rust
12
star
24

sdc-parser

Rust
11
star
25

nom-greedyerror

Custom error type of nom to improve accuracy of error position
Rust
10
star
26

softfloat-wrapper

a safe wrapper of Berkeley SoftFloat based on softfloat-sys
Rust
10
star
27

svlint-action

SystemVerilog
7
star
28

bitpattern

bitwise pattern matching and extracting
Rust
6
star
29

vseq.vim

A Vim plugin for generating sequential number vertically
Vim Script
5
star
30

proc-reader

A std::io::Read implementation for stdout/stderr of other process
Rust
5
star
31

sample-rs

Rust
4
star
32

NeovimClient

Neovim msgpack-rpc Client by C#
C#
4
star
33

svlint-plugin-sample

A sample project of svlint plugin
Rust
4
star
34

rust-plugin-sample

Rust
4
star
35

softfloat_bench

Rust softfloat libarary benchmark
Rust
4
star
36

sv4state

Rust
3
star
37

rust-dpi-sample

SystemVerilog
3
star
38

rustified

Rust
2
star
39

veryl.vim

Vim Script
2
star
40

cc-version

gcc version detection for build.rs
Rust
2
star
41

custom_attribute_sample

Rust
2
star
42

dotfiles

Vim Script
2
star
43

bsd-kvm

Rust
1
star
44

rust-i586

rust-lang build environment for i586
Shell
1
star