headroom-0.1.0.0: License Header Manager
Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Header.Utils

Description

Useful functions for searching specific text fragments in input text, used by other modules to detect existing license headers in source code files.

Synopsis

Documentation

findLine Source #

Arguments

:: (Text -> Bool)

predicate to find line

-> Text

input text

-> Int

number of line that matches given predicate

Finds line in given text that matches given predicate and returns its line number.

findLineStartingWith Source #

Arguments

:: [Text]

patterns to use

-> Text

input text

-> Int

number of line starting with one of patterns

Finds line starting with one of given patterns and returns its line number (specialized form of findLine).

linesCountByRegex Source #

Arguments

:: Regex

regular expression to use

-> Text

input text

-> Int

number of lines matching given regex

Count lines that matches the given (multiline) regex. Useful for example to find how many lines are taken by multi-line comment in source code.

reML :: QuasiQuoter Source #

Regex configuration for matching multi-line UTF strings.