Closed Madumo closed 5 years ago
Credo has an option to check a file from stdin. When this is the case, the source_file.filename is setted to stdin.
source_file.filename
stdin
So when we use this option, the Consistency.ModuleFilename check cannot do it's job since you don't actually have the filename.
Consistency.ModuleFilename
This is a problem with the ElixirLinter extension for VSCode since the extension pass the file through stdin.
I explicitly check if the filename is stdin instead of checking if it starts with stdin to allow the weird use case where someone could have a folder actually called stdin.
Credo has an option to check a file from stdin. When this is the case, the
source_file.filename
is setted tostdin
.So when we use this option, the
Consistency.ModuleFilename
check cannot do it's job since you don't actually have the filename.This is a problem with the ElixirLinter extension for VSCode since the extension pass the file through stdin.
I explicitly check if the filename is stdin instead of checking if it starts with stdin to allow the weird use case where someone could have a folder actually called stdin.