mirego / credo_naming

🏷 A suite of Credo checks to enforce naming best practices in an Elixir project
https://open.mirego.com
BSD 3-Clause "New" or "Revised" License
89 stars 9 forks source link

Always exclude files named 'stdin' in Consistency.ModuleFilename check #7

Closed Madumo closed 5 years ago

Madumo commented 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.

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.