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

^@ in output (unwanted newlines) #2459

Open
nomasprime opened this issue Feb 1, 2020 · 7 comments
Open

^@ in output (unwanted newlines) #2459

nomasprime opened this issue Feb 1, 2020 · 7 comments

Comments

@nomasprime
Copy link

nomasprime commented Feb 1, 2020

Expected behaviour

Getting this output for inline error message:

expect(described_class.all.size).to eq(2)^@  expected: 2^@       got: 1^@  (compared using ==)

Inline error messages shouldn't have repeated whitespace or multiple instances of ^@. Output in quickfix doesn't but it does have other escaped output (see tpope/vim-dispatch#291).

Output from :NeomakeInfo

Neomake debug information

Async support: 1
Current filetype: help
Windows: 0
[shell, shellcmdflag, shellslash]: ['/usr/local/bin/zsh', '-c', 0]
makeprg=make

Enabled makers

For the current filetype ("help", used with :Neomake):

  • writegood
    • args: ['--parse']
    • auto_enabled: 1
    • errorformat: '%W%f:%l:%c:%m,%C%m,%-G'
    • exe: 'writegood'
    • postprocess: function('neomake#makers#ft#text#PostprocessWritegood')
    • WARNINGS:
      • maker's exe (writegood) is not executable.
        NOTE: you can define g:neomake_help_enabled_makers to configure it (or b:neomake_help_enabled_makers).

For the project (used with :Neomake!):

  • makeprg
    • append_file: 0

    • args: []

    • auto_enabled: 1

    • errorformat: '%[^"]"%f"%\D%l: %m,"%f"%\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%[ ]from %f:%l:%c,%-G%[ ]from %f:%l:,%-G%[ ]from %f:%l,,%-G%[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f", line %l%\D%c%[^ ] %m,%D%\a[%\d]: Entering directory %['']%f'',%X%*\a[%*\d]: Leaving directory %*['']%f'',%D%\a: Entering directory %['']%f'',%X%*\a: Leaving directory %*['']%f'',%DMaking %*\a in %f,%f|%l| %m'

    • exe: 'make'

    • version information (/usr/bin/make --version): GNU Make 3.81
      Copyright (C) 2006 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.
      There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
      PARTICULAR PURPOSE.

      This program built for i386-apple-darwin11.3.0
      NOTE: you can define g:neomake_enabled_makers to configure it.

Default maker settings:

  • output_stream: 'both'
  • remove_invalid_entries: 0
  • buffer_output: 1
Settings
New-style (dict, overrides old-style)
g:neomake: {
  'automake': {
    'ignore_filetypes': [
      'startify',
    ],
    'events': {
      'InsertLeave': {},
      'BufWritePost': {
        'delay': 0,
      },
      'TextChanged': {},
    },
  },
  'automake_delay': 500,
}
b:neomake: unset
Old-style
g:neomake_place_signs = 1

:version

NVIM v0.5.0-nightly
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20191207-80848-18ljynw/build/config -I/tmp/neovim-20191207-80848-18ljynw/src -I/usr/local/include -I/tmp/neovim-20191207-80848-18ljynw/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neovim-20191207-80848-18ljynw/build/src/nvim/auto -I/tmp/neovim-20191207-80848-18ljynw/build/include
Compiled by nomasprime@Norma

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-fbae9f8/share/nvim"

Run :checkhealth for more info

:messages

search hit BOTTOM, continuing at TOP
E486: Pattern not found: @
/post                                                                                                                                                                                                                                                                                                              [6/20]
/post                                                                                                                                                                                                                                                                                                              [8/20]
/post                                                                                                                                                                                                                                                                                                              [9/20]
/post                                                                                                                                                                                                                                                                                                             [10/20]
/post                                                                                                                                                                                                                                                                                                             [11/20]
/post                                                                                                                                                                                                                                                                                                             [12/20]
/post                                                                                                                                                                                                                                                                                                             [13/20]
/post                                                                                                                                                                                                                                                                                                             [14/20]
/post                                                                                                                                                                                                                                                                                                             [15/20]
/post                                                                                                                                                                                                                                                                                                             [16/20]
/post                                                                                                                                                                                                                                                                                                             [17/20]
/post                                                                                                                                                                                                                                                                                                             [18/20]
/post                                                                                                                                                                                                                                                                                                             [19/20]
/post                                                                                                                                                                                                                                                                                                             [20/20]
search hit BOTTOM, continuing at TOP
/post                                                                                                                                                                                                                                                                                                            [1/20] W
/post                                                                                                                                                                                                                                                                                                              [2/20]
/post                                                                                                                                                                                                                                                                                                              [3/20]
/post                                                                                                                                                                                                                                                                                                              [4/20]
/post                                                                                                                                                                                                                                                                                                              [5/20]
?post                                                                                                                                                                                                                                                                                                              [5/20]
?post                                                                                                                                                                                                                                                                                                              [4/20]
?post                                                                                                                                                                                                                                                                                                              [3/20]
?post                                                                                                                                                                                                                                                                                                              [2/20]
?post                                                                                                                                                                                                                                                                                                              [1/20]
search hit TOP, continuing at BOTTOM
?post                                                                                                                                                                                                                                                                                                           [20/20] W
@blueyed
Copy link
Member

blueyed commented Feb 3, 2020

"^@" are newlines. The maker could clean them up. IIRC some do so already, and there's a generic helper method for it (also IIRC).

@blueyed
Copy link
Member

blueyed commented Feb 3, 2020

Which maker is it?
You can check running it manually - see the logfile (let g:neomake_logfile = "/tmp/neomake.log") for how it runs and what it gets.

@nomasprime
Copy link
Author

nomasprime commented Feb 7, 2020

Looks like the maker is makeprg. It's called from vim-test.

Log output:

23:33:11 82025 [D  +282] [6.-:3:1] Running makers: makeprg (auto).
23:33:11 82025 [D      ] [-.-:3:1] Cleaning 5 old signs.
23:33:11 82025 [D      ] [-.-:3:1] Using setting append_file=0 from 'maker'.
23:33:11 82025 [V      ] [6.9:3:1] Starting async job: /usr/local/bin/zsh -c './bin/rspec spec/person_spec.rb:10'.
23:33:11 82025 [D      ] [6.9:3:1] cwd: /Users/nomasprime/Organisations/rspec_person_example.
23:33:11 82025 [D +0.50] [6.9:3:1] output on stdout: ['Run options: include {:locations=>{"./spec/person_spec.rb"=>[10]}}', 'F', '', 'Failures:', '', '  1) Person Constructor should create a new instance of class Person', '     Failure/Error: expect(@matt).to be_an_instance_of(String)', '       expected #<Person:0x00007fb319ab46d0 @name="Matt", @language="English"> to be an instance of String', '     # ./spec/person_spec.rb:10:in `block (3 levels) in <top (required)>''', '', 'Finished in 0.02821 seconds (files took 0.09177 seconds to load)', '1 example, 1 failure', '', 'Failed examples:', '', 'rspec ./spec/person_spec.rb:9 # Person Constructor should create a new instance of class Person', '', ''].
23:33:11 82025 [D      ] [6.9:3:1] exit: makeprg: 1.
23:33:11 82025 [D      ] [6.9:3:1] Processing 17 lines of output.
23:33:11 82025 [D      ] [6.-:3:1] Adding 1 list entries.
23:33:11 82025 [D      ] [6.-:3:1] Creating quickfix list for entries.
23:33:11 82025 [D      ] list: call: set: [[], ' ', {'context': {'neomake': {'make_info': 'make_id=6'}}, 'items': [], 'title': 'Neomake[project]: makeprg...'}].
23:33:11 82025 [D      ] list: got qfid (action=set): 15.
23:33:11 82025 [D      ] list: call: set: [[], 'a', {'id': 15, 'items': [{'lnum': 10, 'bufnr': 3, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'module': '', 'type': 'E', 'pattern': '', 'text': 'expect(@matt).to be_an_instance_of(String)  expected #<Person:0x00007fb319ab46d0 @name="Matt", @language="English"> to be an instance of String'}], 'title': 'Neomake[project]: makeprg...'}].
23:33:11 82025 [D      ] list: call: "get", returning items: [['getqflist', [{'id': 15, 'items': 1}]]].
23:33:11 82025 [D      ] [6.9:3:1] Processing 1 entries.
23:33:11 82025 [D      ] [6.-:3:1] Project-level errors cleaned.
23:33:11 82025 [D      ] [-.-:3:1] Placing sign: sign place 5017 line=10 name=neomake_project_err buffer=3.
23:33:11 82025 [D      ] [6.9:3:1] makeprg: completed with exit code 1.
23:33:11 82025 [D      ] [6.9:3:1] Cleaning jobinfo.
23:33:11 82025 [D      ] Removing signs: {file: {}, project: {}}.
23:33:11 82025 [D      ] WideMessage: echo makeprg: expect(@matt).to be_an_instance_of(String)   expected #<Person:0x00007fb319ab46d0 @name="Matt", @language="English"> to be an instance of String (E).
23:33:11 82025 [D      ] list: call: "title": [[], 'a', {'id': 15, 'title': 'Neomake[project]: makeprg(1)'}].
23:33:11 82025 [D      ] [6.-:3:1] Cleaning make info.

@nomasprime
Copy link
Author

@blueyed any suggestions?

I'm curious, as messages are displayed inline, why removing these characters isn't applied to all makers?

@nomasprime
Copy link
Author

Unfortunately I can't get any of the postprocess doc examples to work.

@nomasprime
Copy link
Author

Finally got correct output with let g:neomake_postprocess = 'neomake#postprocess#compress_whitespace'.

No idea why this isn't the default.

@blueyed
Copy link
Member

blueyed commented Feb 20, 2020

@nomasprime
Sorry for the trouble - I'm glad you've figured it out.
It should maybe get added to the docs at least - using it by default might not be desirable, e.g. for when you care about the newlines etc.
But it could be added for the "makeprg" maker's default then maybe or something similar.

@blueyed blueyed changed the title ^@ in output ^@ in output (unwanted newlines) Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants