Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
A
attic
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
hydrargyrum
attic
Commits
94320ba6
Commit
94320ba6
authored
Oct 11, 2020
by
hydrargyrum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log-snippet: add README
parent
de8d94b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
log-snippet/README.md
log-snippet/README.md
+52
-0
No files found.
log-snippet/README.md
0 → 100644
View file @
94320ba6
# log-snippet
log-snippet takes an arbitrary "compilation-log" and shows contextual lines, a bit like
`grep -C`
# Synopsis
log-snippet [-C CONTEXTLINES] < LOG
# Example
Take for example the output of
`flake8`
command:
```
% flake8 bad.py other.py
bad.py:4:8: E225 missing whitespace around operator
bad.py:17:5: E303 too many blank lines (2)
other.py:3:10: E201 whitespace after '('
```
... which yields filenames and line numbers, one per line.
For each file/line number,
`log-snippet`
will show the content of the line number of the file, with optional context lines.
For example, pipe
`flake8`
output into
`log-snippet`
and show up to 2 lines before and 2 lines after around the mentioned line:
```
% flake8 bad.py other.py | ~/progextern/attic/log-snippet/log-snippet.sh -C 2
bad.py-2-
bad.py-3-def foo1():
bad.py:4: qux=1
bad.py-5- print(qux)
bad.py-6-
--
bad.py-15-
bad.py-16-
bad.py:17: c = 3
bad.py-18- print(a, b, c)
--
other.py-1-
other.py-2-
other.py:3:def foo2( ):
other.py-4- if(1):
other.py-5- print('foo')
```
The default is
`-C 5`
.
# Compilation log format
The format accepted by log-snippet is used by many compilers and linters, for example flake8, gcc, etc.
`log-snippet`
output format is similar to the format returned by
`grep -H -n -C 5`
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment