Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: make v check-md . print the actual length of lines too, when reporting errors/warnings about them #23606

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/tools/vcheck-md.v
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ struct CheckResultContext {

fn (mut f MDFile) wcheck(actual int, limit int, ctx CheckResultContext, msg_template string) {
if actual > limit {
wprintln(wline(ctx.path, ctx.line_number, ctx.line.len, msg_template.replace('@',
limit.str())))
final := msg_template.replace('@', limit.str()) + ', actual: ' + actual.str()
wprintln(wline(ctx.path, ctx.line_number, ctx.line.len, final))
wprintln(ctx.line)
wprintln(ftext('-'.repeat(limit) + '^', term.gray))
f.warnings++
Expand All @@ -201,8 +201,8 @@ fn (mut f MDFile) wcheck(actual int, limit int, ctx CheckResultContext, msg_temp

fn (mut f MDFile) echeck(actual int, limit int, ctx CheckResultContext, msg_template string) {
if actual > limit {
eprintln(eline(ctx.path, ctx.line_number, ctx.line.len, msg_template.replace('@',
limit.str())))
final := msg_template.replace('@', limit.str()) + ', actual: ' + actual.str()
eprintln(eline(ctx.path, ctx.line_number, ctx.line.len, final))
eprintln(ctx.line)
eprintln(ftext('-'.repeat(limit) + '^', term.gray))
f.errors++
Expand Down
Loading