Skip to content

m-aXimilian/cl-lineparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Line Parser

https://gitlab.com/m-aXimilian/buildwarning-parser/badges/master/pipeline.svg

A simple filter that finds occurrences of a string in a textfile of many lines. It is doing its thing line-by-line, so the whole file is not bloated into memory. Text formatting is assumed to be iso-8859-1.

Loading development environment

In a SLIME-repl do the following:

(asdf:load-asd #P"d:/Projects/line-parser/line-parser.asd") ;; or wherever the asd file is located
(ql:quickload "line-parser")

Usage

From the repl

The method duplicate-free-warnings can be used as an entry point directly. Pass it a string for the warning id and one for the path to the input file with all buildwarnings.

(duplicate-free-warnings "CA2016" "d:/buildwarnings/ca2016-secondfix")

From the commandline

The executable accepts the following commandline arguments

short namelong namedescription
–helpdisplay usage information and exit
–versiondisplay version and exit
-d–drop <VALUE>The string after which the rest of the line is dropped. Ignored if nothing is specified.
-i–input <VALUE>The path to the input file with the buildoutput.
-o–output <VALUE>The output file to store the results in.
-r–raw-resultsSave additional raw results, i.e., containing duplicates as well.
-s–silentRun silent. Don’t print results to the standard output.
-w–warning <VALUE>The warning key. (Some random string that gets filtered)

w is basically any string, so this will filter any line in any file, that contains the warning id string.

e.g.:

./line-parser -w CA2016 -i /path/to/inputfile -o /path/to/outputfile -d ")" -r

This will search for occurences of “CA2016” (w tag) in the inputfile (i tag) and drop all the findings cropped after the “)” character (d tag) and without duplicates in the “outputfile” (o tag). With the r tag, the raw findings will be preserved in “outputfile-raw”.

Building

With Makefile

In the directory of the Makefile, run

make

This will drop the executable in a the build subfolder.

With REPL

  1. Start sbcl from the command line
    sbcl
        
  2. Load the asdf-system
    (asdf:load-asd #P"d:/Projects/line-parser/line-parser.asd") ;; or wherever the asd file is located
        
  3. Quickload it
    (ql:quickload "line-parser")   
        
  4. Use asdf:make or (sb-ext:save-lisp-and-die) to make an executable
    (asdf:make :line-parser)
    ;; way easier via asdf...
    ;; (sb-ext:save-lisp-and-die #P"d:/Projects/line-parser/build/line-parser" :toplevel #'line-parser:main :executable t)
        

Testing

With Makefile

Run make test in the directory of the Makefile.

With REPL

Do the following

(asdf:load-asd #p"~/repos/line-parser/line-parser.asd")
(ql:quickload "line-parser/tests")
;; make sure the the current working direcotry is set to <PROJECT_ROOT>/tests
;; i.e. by pressing C-c-~ in SLIME
(run! 'lparser)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published