blib/lib/App/Ack/ConfigDefault.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 93.1% 27 / 29 CC 2 SCAR 2.5
CC
2
Cov
100%
options_clean
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/App/Ack/Filter/IsPath.pm ↑ Summary blib/lib/App/Ack/Filter/IsGroup.pm »
1 package App::Ack::ConfigDefault;
2  
3 584 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 584 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 584 ▶use App::Ack ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 =head1 NAME
10  
11 App::Ack::ConfigDefault
12  
13 =head1 DESCRIPTION
14  
15 A module that contains the default configuration for ack.
16  
17 =cut
18  
19 573 ▶sub options {
Subroutine options: called CC=1 SCAR=0.0
Pod undocumented
20 573 return split( /\n/, _options_block() );
21 }
22  
23  
24 571 ▶sub options_clean {
Subroutine options_clean: called CC=2 SCAR=6.9
Pod undocumented
25 571 ▶ return grep { /./ && !/^#/ } options();
Condition100%3/3
/./ && !/^#/
!ll&&!rl&&r
7080413133085079
MC/DC100%2/2
/./ && !/^#/
/./ !/^#/
Truth table100%3/3
A && not(B)
A= /./B= !/^#/
ABresult
0X0
100
111
26 }
27  
28  
29 573 ▶sub _options_block {
Subroutine _options_block: called CC=1 SCAR=0.0
30 573 my $lines = <<'HERE';
31 # This is the default ackrc for ack version ==VERSION==.
32  
33 # There are four different ways to match
34 #
35 # is: Match the filename exactly
36 #
37 # ext: Match the extension of the filename exactly
38 #
39 # match: Match the filename against a Perl regular expression
40 #
41 # firstlinematch: Match the first 250 characters of the first line
42 # of text against a Perl regular expression. This is only for
43 # the --type-add option.
44  
45  
46 ### Directories to ignore
47  
48 # Bazaar
49 # https://bazaar.canonical.com/
50 --ignore-directory=is:.bzr
51  
52 # Codeville
53 # http://freshmeat.sourceforge.net/projects/codeville
54 --ignore-directory=is:.cdv
55  
56 # Interface Builder (Xcode)
57 # https://en.wikipedia.org/wiki/Interface_Builder
58 --ignore-directory=is:~.dep
59 --ignore-directory=is:~.dot
60 --ignore-directory=is:~.nib
61 --ignore-directory=is:~.plst
62  
63 # Git
64 # https://git-scm.com/
65 --ignore-directory=is:.git
66 # When submodules are used, .git is a file.
67 --ignore-file=is:.git
68  
69 # Mercurial
70 # https://www.mercurial-scm.org/
71 --ignore-directory=is:.hg
72  
73 # Quilt
74 # https://directory.fsf.org/wiki/Quilt
75 --ignore-directory=is:.pc
76  
77 # Subversion
78 # https://subversion.apache.org/
79 --ignore-directory=is:.svn
80  
81 # Monotone
82 # https://www.monotone.ca/
83 --ignore-directory=is:_MTN
84  
85 # CVS
86 # https://savannah.nongnu.org/projects/cvs
87 --ignore-directory=is:CVS
88  
89 # RCS
90 # https://www.gnu.org/software/rcs/
91 --ignore-directory=is:RCS
92  
93 # SCCS
94 # https://en.wikipedia.org/wiki/Source_Code_Control_System
95 --ignore-directory=is:SCCS
96  
97 # darcs
98 # http://darcs.net/
99 --ignore-directory=is:_darcs
100  
101 # Vault/Fortress
102 --ignore-directory=is:_sgbak
103  
104 # autoconf
105 # https://www.gnu.org/software/autoconf/
106 --ignore-directory=is:autom4te.cache
107  
108 # Perl module building
109 --ignore-directory=is:blib
110 --ignore-directory=is:_build
111  
112 # Perl Devel::Cover module's output directory
113 # https://metacpan.org/release/Devel-Cover
114 --ignore-directory=is:cover_db
115  
116 # Node modules created by npm
117 --ignore-directory=is:node_modules
118  
119 # CMake cache
120 # https://www.cmake.org/
121 --ignore-directory=is:CMakeFiles
122  
123 # Eclipse workspace folder
124 # https://eclipse.org/
125 --ignore-directory=is:.metadata
126  
127 # Cabal (Haskell) sandboxes
128 # https://www.haskell.org/cabal/users-guide/installing-packages.html
129 --ignore-directory=is:.cabal-sandbox
130  
131 # Python caches
132 # https://docs.python.org/3/tutorial/modules.html
133 --ignore-directory=is:__pycache__
134 --ignore-directory=is:.pytest_cache
135  
136 # macOS Finder remnants
137 --ignore-directory=is:__MACOSX
138 --ignore-file=is:.DS_Store
139  
140 ### Files to ignore
141  
142 # Backup files
143 --ignore-file=ext:bak
144 --ignore-file=match:/~$/
145  
146 # Emacs swap files
147 --ignore-file=match:/^#.+#$/
148  
149 # vi/vim swap files https://www.vim.org/
150 --ignore-file=match:/[._].*[.]swp$/
151  
152 # core dumps
153 --ignore-file=match:/core[.]\d+$/
154  
155 # minified JavaScript
156 --ignore-file=match:/[.-]min[.]js$/
157 --ignore-file=match:/[.]js[.]min$/
158  
159 # minified CSS
160 --ignore-file=match:/[.]min[.]css$/
161 --ignore-file=match:/[.]css[.]min$/
162  
163 # JS and CSS source maps
164 --ignore-file=match:/[.]js[.]map$/
165 --ignore-file=match:/[.]css[.]map$/
166  
167 # PDFs, because they pass Perl's -T detection
168 --ignore-file=ext:pdf
169  
170 # Common graphics, just as an optimization
171 --ignore-file=ext:gif,jpg,jpeg,png
172  
173 # Common archives, as an optimization
174 --ignore-file=ext:gz,tar,tgz,zip
175  
176 # Python compiled modules
177 --ignore-file=ext:pyc,pyd,pyo
178  
179 # Python's pickle serialization format
180 # https://docs.python.org/2/library/pickle.html#example
181 # https://docs.python.org/3.7/library/pickle.html#examples
182 --ignore-file=ext:pkl,pickle
183  
184 # C extensions
185 --ignore-file=ext:so
186  
187 # Compiled gettext files
188 --ignore-file=ext:mo
189  
190 # Visual Studio user and workspace settings
191 # https://code.visualstudio.com/docs/getstarted/settings
192 --ignore-dir=is:.vscode
193  
194 ### Filetypes defined
195  
196 # Makefiles
197 # https://www.gnu.org/s/make/
198 --type-add=make:ext:mk
199 --type-add=make:ext:mak
200 --type-add=make:is:makefile
201 --type-add=make:is:Makefile
202 --type-add=make:is:Makefile.Debug
203 --type-add=make:is:Makefile.Release
204 --type-add=make:is:GNUmakefile
205  
206 # Rakefiles
207 # https://rake.rubyforge.org/
208 --type-add=rake:is:Rakefile
209  
210 # CMake
211 # https://cmake.org/
212 --type-add=cmake:is:CMakeLists.txt
213 --type-add=cmake:ext:cmake
214  
215 # Bazel build tool
216 # https://docs.bazel.build/versions/master/skylark/bzl-style.html
217 --type-add=bazel:ext:bzl
218 # https://docs.bazel.build/versions/master/guide.html#bazelrc-the-bazel-configuration-file
219 --type-add=bazel:ext:bazelrc
220 # https://docs.bazel.build/versions/master/build-ref.html#BUILD_files
221 --type-add=bazel:is:BUILD
222 # https://docs.bazel.build/versions/master/build-ref.html#workspace
223 --type-add=bazel:is:WORKSPACE
224  
225  
226 # Actionscript
227 --type-add=actionscript:ext:as,mxml
228  
229 # Ada
230 # https://www.adaic.org/
231 --type-add=ada:ext:ada,adb,ads
232  
233 # ASP
234 # https://docs.microsoft.com/en-us/previous-versions/office/developer/server-technologies/aa286483(v=msdn.10)
235 --type-add=asp:ext:asp
236  
237 # ASP.Net
238 # https://dotnet.microsoft.com/apps/aspnet
239 --type-add=aspx:ext:master,ascx,asmx,aspx,svc
240  
241 # Assembly
242 --type-add=asm:ext:asm,s
243  
244 # DOS/Windows batch
245 --type-add=batch:ext:bat,cmd
246  
247 # ColdFusion
248 # https://en.wikipedia.org/wiki/ColdFusion
249 --type-add=cfmx:ext:cfc,cfm,cfml
250  
251 # Clojure
252 # https://clojure.org/
253 --type-add=clojure:ext:clj,cljs,edn,cljc
254  
255 # C
256 # .xs are Perl C files
257 --type-add=cc:ext:c,h,xs
258  
259 # C header files
260 --type-add=hh:ext:h
261  
262 # CoffeeScript
263 # https://coffeescript.org/
264 --type-add=coffeescript:ext:coffee
265  
266 # C++
267 --type-add=cpp:ext:cpp,cc,cxx,m,hpp,hh,h,hxx
268  
269 # C++ header files
270 --type-add=hpp:ext:hpp,hh,h,hxx
271  
272 # C#
273 --type-add=csharp:ext:cs
274  
275 # Crystal-lang
276 # https://crystal-lang.org/
277 --type-add=crystal:ext:cr,ecr
278  
279 # CSS
280 # https://www.w3.org/Style/CSS/
281 --type-add=css:ext:css
282  
283 # Dart
284 # https://dart.dev/
285 --type-add=dart:ext:dart
286  
287 # Delphi
288 # https://en.wikipedia.org/wiki/Embarcadero_Delphi
289 --type-add=delphi:ext:pas,int,dfm,nfm,dof,dpk,dproj,groupproj,bdsgroup,bdsproj
290  
291 # Elixir
292 # https://elixir-lang.org/
293 --type-add=elixir:ext:ex,exs
294  
295 # Elm
296 # https://elm-lang.org
297 --type-add=elm:ext:elm
298  
299 # Emacs Lisp
300 # https://www.gnu.org/software/emacs
301 --type-add=elisp:ext:el
302  
303 # Erlang
304 # https://www.erlang.org/
305 --type-add=erlang:ext:erl,hrl
306  
307 # Fortran
308 # https://en.wikipedia.org/wiki/Fortran
309 --type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp
310  
311 # Go
312 # https://golang.org/
313 --type-add=go:ext:go
314  
315 # Groovy
316 # https://www.groovy-lang.org/
317 --type-add=groovy:ext:groovy,gtmpl,gpp,grunit,gradle
318  
319 # GSP
320 # https://gsp.grails.org/
321 --type-add=gsp:ext:gsp
322  
323 # Haskell
324 # https://www.haskell.org/
325 --type-add=haskell:ext:hs,lhs
326  
327 # HTML
328 --type-add=html:ext:htm,html,xhtml
329  
330 # Jade
331 # http://jade-lang.com/
332 --type-add=jade:ext:jade
333  
334 # Java
335 # https://www.oracle.com/technetwork/java/index.html
336 --type-add=java:ext:java,properties
337  
338 # JavaScript
339 --type-add=js:ext:js
340  
341 # JSP
342 # https://www.oracle.com/technetwork/java/javaee/jsp/index.html
343 --type-add=jsp:ext:jsp,jspx,jspf,jhtm,jhtml
344  
345 # JSON
346 # https://json.org/
347 --type-add=json:ext:json
348  
349 # Kotlin
350 # https://kotlinlang.org/
351 --type-add=kotlin:ext:kt,kts
352  
353 # Less
354 # http://www.lesscss.org/
355 --type-add=less:ext:less
356  
357 # Common Lisp
358 # https://common-lisp.net/
359 --type-add=lisp:ext:lisp,lsp
360  
361 # Lua
362 # https://www.lua.org/
363 --type-add=lua:ext:lua
364 --type-add=lua:firstlinematch:/^#!.*\blua(jit)?/
365  
366 # Markdown
367 # https://en.wikipedia.org/wiki/Markdown
368 --type-add=markdown:ext:md,markdown
369 # We understand that there are many ad hoc extensions for markdown
370 # that people use. .md and .markdown are the two that ack recognizes.
371 # You are free to add your own in your ackrc file.
372  
373 # Matlab
374 # https://en.wikipedia.org/wiki/MATLAB
375 --type-add=matlab:ext:m
376  
377 # Objective-C
378 --type-add=objc:ext:m,h
379  
380 # Objective-C++
381 --type-add=objcpp:ext:mm,h
382  
383 # OCaml
384 # https://ocaml.org/
385 --type-add=ocaml:ext:ml,mli,mll,mly
386  
387 # Perl
388 # https://perl.org/
389 --type-add=perl:ext:pl,pm,pod,t,psgi
390 --type-add=perl:firstlinematch:/^#!.*\bperl/
391  
392 # Perl tests
393 --type-add=perltest:ext:t
394  
395 # Perl's Plain Old Documentation format, POD
396 --type-add=pod:ext:pod
397  
398 # PHP
399 # https://www.php.net/
400 --type-add=php:ext:php,phpt,php3,php4,php5,phtml
401 --type-add=php:firstlinematch:/^#!.*\bphp/
402  
403 # Plone
404 # https://plone.org/
405 --type-add=plone:ext:pt,cpt,metadata,cpy,py
406  
407 # PowerShell
408 # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts
409 # https://learn.microsoft.com/en-us/powershell/scripting/developer/module/understanding-a-windows-powershell-module
410 --type-add=powershell:ext:ps1,psm1
411  
412 # PureScript
413 # https://www.purescript.org
414 --type-add=purescript:ext:purs
415  
416 # Python
417 # https://www.python.org/
418 --type-add=python:ext:py
419 --type-add=python:firstlinematch:/^#!.*\bpython/
420  
421 # Pytest
422 # https://pytest.org/
423 # Pytest files are *.py files that start with test_ or end with _test.py
424 # https://docs.pytest.org/en/stable/explanation/goodpractices.html#test-discovery
425 --type-add=pytest:match:_test\.py$
426 --type-add=pytest:match:^test_.*\.py$
427  
428 # R
429 # https://www.r-project.org/
430 # https://r4ds.had.co.nz/r-markdown.html
431 --type-add=rr:ext:R,Rmd
432  
433 # reStructured Text
434 # https://docutils.sourceforge.io/rst.html
435 --type-add=rst:ext:rst
436  
437 # Ruby
438 # https://www.ruby-lang.org/
439 --type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec
440 --type-add=ruby:is:Rakefile
441 --type-add=ruby:firstlinematch:/^#!.*\bruby/
442  
443 # Rust
444 # https://www.rust-lang.org/
445 --type-add=rust:ext:rs
446  
447 # Sass
448 # https://sass-lang.com
449 --type-add=sass:ext:sass,scss
450  
451 # Scala
452 # https://www.scala-lang.org/
453 --type-add=scala:ext:scala,sbt
454  
455 # Scheme
456 # https://groups.csail.mit.edu/mac/projects/scheme/
457 --type-add=scheme:ext:scm,ss
458  
459 # Shell
460 --type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
461 --type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
462  
463 # Smalltalk
464 # http://www.smalltalk.org/
465 --type-add=smalltalk:ext:st
466  
467 # Smarty
468 # https://www.smarty.net/
469 --type-add=smarty:ext:tpl
470  
471 # SQL
472 # https://www.iso.org/standard/45498.html
473 --type-add=sql:ext:sql,ctl
474  
475 # Stylus
476 # http://stylus-lang.com/
477 --type-add=stylus:ext:styl
478  
479 # SVG
480 # https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
481 --type-add=svg:ext:svg
482  
483 # Swift
484 # https://developer.apple.com/swift/
485 --type-add=swift:ext:swift
486 --type-add=swift:firstlinematch:/^#!.*\bswift/
487  
488 # Tcl
489 # https://www.tcl.tk/
490 --type-add=tcl:ext:tcl,itcl,itk
491  
492 # Terraform
493 # https://github.com/hashicorp/terraform
494 --type-add=terraform=.tf,.tfvars
495  
496 # TeX & LaTeX
497 # https://www.latex-project.org/
498 --type-add=tex:ext:tex,cls,sty
499  
500 # Template Toolkit (Perl)
501 # http//template-toolkit.org/
502 --type-add=ttml:ext:tt,tt2,ttml
503  
504 # TOML
505 # https://toml.io/
506 --type-add=toml:ext:toml
507  
508 # TypeScript
509 # https://www.typescriptlang.org/
510 --type-add=ts:ext:ts,tsx
511  
512 # Visual Basic
513 --type-add=vb:ext:bas,cls,frm,ctl,vb,resx
514  
515 # Verilog
516 --type-add=verilog:ext:v,vh,sv
517  
518 # VHDL
519 # http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome
520 --type-add=vhdl:ext:vhd,vhdl
521  
522 # Vim
523 # https://www.vim.org/
524 --type-add=vim:ext:vim
525  
526 # XML
527 # https://www.w3.org/TR/REC-xml/
528 --type-add=xml:ext:xml,dtd,xsd,xsl,xslt,ent,wsdl
529 --type-add=xml:firstlinematch:/<[?]xml/
530  
531 # YAML
532 # https://yaml.org/
533 --type-add=yaml:ext:yaml,yml
534 HERE
535 573 $lines =~ s/==VERSION==/$App::Ack::VERSION/sm;
536  
537 573 return $lines;
538 }
539  
540 584 1;
« blib/lib/App/Ack/Filter/IsPath.pm ↑ Summary blib/lib/App/Ack/Filter/IsGroup.pm »