Add option to `inko check` that overrides the file path to use for deriving the module name
Linters such as https://github.com/jose-elias-alvarez/null-ls.nvim may wish to support linting as you type. For this to work they typically pass input through STDIN, or using a temporary file.
The compiler is file based (as in, it assumes the code it's working with exists on disk), so STDIN as input would require generating a temporary file, which I want to avoid. But when a linter passes in a temporary file, it won't have the original name (i.e. you end up with /tmp/test123-string.inko
instead of std/string.inko
). As a result, Inko may think the file falls outside of the project and adjust certain rules/behaviours accordingly (i.e. disallowing _INKO.x
for files that should have acces to it).
To handle this, inko check
should support an option that allows you to override the file path to use for deriving the main module name, but only if an explicit input file is given. That is, inko check --the-name-of-thag-flag ./libstd/src/std/string.inko
is invalid, but inko check --the-name-of-that-flag ./libstd/src/std/string.inko /tmp/temp-123-string.inko
is valid.
I'm not sure yet what the name of this flag should be.