Comments (6)
I've just spotted that the unwanted trailing line was introduced at d6a76b3 to fix #131, so perhaps it's not so straighforward.
from nvim-lint.
Can you try with #145?
from nvim-lint.
This works fine for me - but isn't it what we had before 7fb6ae1? Will this reopen #127?
from nvim-lint.
Maybe something like this:
diff --git a/lua/lint.lua b/lua/lint.lua
index fee3ac7..4918463 100644
--- a/lua/lint.lua
+++ b/lua/lint.lua
@@ -165,10 +165,8 @@ function M.lint(linter)
start_read(linter.stream, stdout, stderr, bufnr, parser, ns)
if linter.stdin then
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, true)
- for _, line in ipairs(lines) do
- stdin:write(line .. '\n')
- end
- stdin:write('\n', function()
+ local content = table.concat(lines, '\n')
+ stdin:write(content .. '\n', function()
stdin:shutdown(function()
stdin:close()
end)
I couldn't find a way of getting the actual content of the buffer rather than this line-by-line reconstruction, which seems to me unsatisfactory - eg what if the linter wants to warn you that you have mixed line endings? But perhaps this will do.
from nvim-lint.
This works fine for me - but isn't it what we had before 7fb6ae1? Will this reopen #127?
It's similar yes, but with the new PR the shutdown also uses the callback before invoking close.
Maybe something like this:
This also sends a trailing \n
? Not sure why it would be better than the status quo?
from nvim-lint.
my version sent only a single trailing newline - which should be present in every posix-compliant file.
However if I'd misread your proposal and it's not going to re-break #127, it's all good - thanks!
from nvim-lint.
Related Issues (20)
- Linting & stdin -- workaround
- Bug and touch-ups for trivy v0.51.2 (with a proposed fix) HOT 2
- Actionlint lints all YAML files HOT 2
- Linter with name `markdownlint-cli2` not available HOT 1
- Can't make oxlint work HOT 1
- flake8 config not recognized HOT 2
- Configuration for `selene` HOT 5
- ktlint: Parser failed. <...> Expected value but found invalid token at character 1
- `ansible-lint` not available HOT 1
- Provide Mechanism to Disable Linter in Neo-Tree Buffer HOT 1
- eslint_d unable to recognize the 9.x version of the configuration file HOT 5
- HELP: Looking for a way to toggle a specific linter HOT 2
- nvim-lint can't find Mason installed pylint HOT 1
- (eslint) Question: How to hide names of rules? HOT 1
- QUESTION: how are linters found? HOT 2
- HELP: is ansible-lint working? HOT 1
- mypy not running in the context of nvim-lint with pyproject.toml settings. HOT 1
- nvim-lint to identify traceback errors and show inlayed hints using mypy HOT 1
- PHPInsights parse error
- feature request: from_patterns HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-lint.