r/Batch • u/zaphodikus • 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
View all comments
Show parent comment
1
u/T3RRYT3RR0R Oct 15 '26
I wouldn't place much faith in any AI system being particularly accurate with windows batch scripts, either to produce it or error check, as none are trained to a sufficient level of detail on Batch parsing rules.
The parsing rules for batch are somewhat complex, though have been studied and documented in depth at https://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/4095133#4095133
Don't have a recomendation for a linter though. If you have Visual Studio available to you, it's a useful enough tool to help keep track of indentation and the likes, and has github copilot built in if you need to ask how to do x y or z.
As for the "batch is less a language more a parser" - Can't agree here.
Cmd.exe is the parser
Windows batch is a scripting language with significant constraints and a limited set of primitives, yes. But it is still a language that can be used to do many things beyond it's original intent.
What really limits batch is the lack of efficient data structures, the way it handles memory, and the requirement to hybridise with other scripting languages in order to directly access modern windows APIs.