File Coverage

blib/lib/App/Ack/ConfigDefault.pm
Criterion Covered Total %
statement 9 15 60.0
branch 0 2 0.0
condition n/a
subroutine 3 6 50.0
pod 0 2 0.0
total 12 25 48.0


line stmt bran cond sub pod time code
1             package App::Ack::ConfigDefault;
2              
3 2     2   10509 use warnings;
  2         4  
  2         56  
4 2     2   8 use strict;
  2         4  
  2         30  
5              
6 2     2   8 use App::Ack ();
  2         3  
  2         524  
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             sub options {
20 0     0 0   return split( /\n/, _options_block() );
21             }
22              
23              
24             sub options_clean {
25 0 0   0 0   return grep { /./ && !/^#/ } options();
  0            
26             }
27              
28              
29             sub _options_block {
30 0     0     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=.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             # PureScript
408             # https://www.purescript.org
409             --type-add=purescript:ext:purs
410              
411             # Python
412             # https://www.python.org/
413             --type-add=python:ext:py
414             --type-add=python:firstlinematch:/^#!.*\bpython/
415              
416             # R
417             # https://www.r-project.org/
418             --type-add=rr:ext:R
419              
420             # reStructured Text
421             # https://docutils.sourceforge.io/rst.html
422             --type-add=rst:ext:rst
423              
424             # Ruby
425             # https://www.ruby-lang.org/
426             --type-add=ruby:ext:rb,rhtml,rjs,rxml,erb,rake,spec
427             --type-add=ruby:is:Rakefile
428             --type-add=ruby:firstlinematch:/^#!.*\bruby/
429              
430             # Rust
431             # https://www.rust-lang.org/
432             --type-add=rust:ext:rs
433              
434             # Sass
435             # https://sass-lang.com
436             --type-add=sass:ext:sass,scss
437              
438             # Scala
439             # https://www.scala-lang.org/
440             --type-add=scala:ext:scala,sbt
441              
442             # Scheme
443             # https://groups.csail.mit.edu/mac/projects/scheme/
444             --type-add=scheme:ext:scm,ss
445              
446             # Shell
447             --type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
448             --type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
449              
450             # Smalltalk
451             # http://www.smalltalk.org/
452             --type-add=smalltalk:ext:st
453              
454             # Smarty
455             # https://www.smarty.net/
456             --type-add=smarty:ext:tpl
457              
458             # SQL
459             # https://www.iso.org/standard/45498.html
460             --type-add=sql:ext:sql,ctl
461              
462             # Stylus
463             # http://stylus-lang.com/
464             --type-add=stylus:ext:styl
465              
466             # SVG
467             # https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
468             --type-add=svg:ext:svg
469              
470             # Swift
471             # https://developer.apple.com/swift/
472             --type-add=swift:ext:swift
473             --type-add=swift:firstlinematch:/^#!.*\bswift/
474              
475             # Tcl
476             # https://www.tcl.tk/
477             --type-add=tcl:ext:tcl,itcl,itk
478              
479             # TeX & LaTeX
480             # https://www.latex-project.org/
481             --type-add=tex:ext:tex,cls,sty
482              
483             # Template Toolkit (Perl)
484             # http//template-toolkit.org/
485             --type-add=ttml:ext:tt,tt2,ttml
486              
487             # TOML
488             # https://toml.io/
489             --type-add=toml:ext:toml
490              
491             # TypeScript
492             # https://www.typescriptlang.org/
493             --type-add=ts:ext:ts,tsx
494              
495             # Visual Basic
496             --type-add=vb:ext:bas,cls,frm,ctl,vb,resx
497              
498             # Verilog
499             --type-add=verilog:ext:v,vh,sv
500              
501             # VHDL
502             # http://www.eda.org/twiki/bin/view.cgi/P1076/WebHome
503             --type-add=vhdl:ext:vhd,vhdl
504              
505             # Vim
506             # https://www.vim.org/
507             --type-add=vim:ext:vim
508              
509             # XML
510             # https://www.w3.org/TR/REC-xml/
511             --type-add=xml:ext:xml,dtd,xsd,xsl,xslt,ent,wsdl
512             --type-add=xml:firstlinematch:/<[?]xml/
513              
514             # YAML
515             # https://yaml.org/
516             --type-add=yaml:ext:yaml,yml
517             HERE
518 0           $lines =~ s/==VERSION==/$App::Ack::VERSION/sm;
519              
520 0           return $lines;
521             }
522              
523             1;