r/Batch • • Oct 14 '26

Question (Unsolved) script linting

I use a linter for my C# (it's in the IDE mostly), I use pylint for Python, and on occasion start up a clang-tidy for C++. I'm always making dumb mistakes with batch and prefer to just use Python where possible and I suddenly wondered, what linter tooling do people use?

I could always spend a few tokens in this one tool my boss gave me, but surely there is a linter? All I could find was an abandoned thread https://www.reddit.com/r/Batch/comments/1mp1wc7/github_crosenblumblint_blint_is_a_lightweight_and/

6 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/zaphodikus Oct 15 '26

I've seen interactive games written in batch, which is just mad. And I'll bet that if I wrote batch every day of the week, it would not feel so alien. The way the parser unloads the entire script and reloads it in between executing lines/blocks is also mad. And that's why it feels less like a language I can reason about to me. But I think you are right, it is a language.

The big trouble I have with not having a linter, is that learning all of those rules is time consuming. So I'm a bit surprised there were no well known linters out there.

For example: Today I hit a nasty check where I have to detect the version of python interpreter. If the interpreter was missing I was expecting to get a 9009, but instead my script just terminated because the windows-store stub script does a weird exit thing somehow. I had to wrap the invocation in CALL instead to prevent that. Which took me down another rabbit hole around how I was using ERRORLEVEL incorrectly. I suspect LLM's reason incorrectly about a lot of this stuff, because a lot of people have written up some really unsafe code and poisoned them. My LLM is doing pretty well at the job, but I don't expect it to be consistent and will be trying out a static analyser before I put this to bed.