get-alex / alex

Catch insensitive, inconsiderate writing
https://alexjs.com
MIT License
4.82k stars 207 forks source link

Files without file extension are not included for linting #338

Closed tymonx closed 1 year ago

tymonx commented 1 year ago

Subject of the issue

Files without file extension are not included for linting. Example: README.

Your environment

11.0.0
NODE_VERSION=19.8.1
YARN_VERSION=1.22.19

Steps to reproduce

  1. Create file without file extension:
echo "pop" > README
  1. Run alex:
podman run -it --rm --volume "$(pwd):/alex:ro,z" --workdir "/alex" registry.gitlab.com/pipeline-components/alex:0.21.9 --why .

Expected behaviour

It should return status code 1 and print:

README
  1:1-1:4  warning  `pop` may be insensitive, use `parent` instead  dad-mom  retext-equality

⚠ 1 warning

Actual behaviour

It returns status code 0 (success) without printing anything to standard output or error output.

Workaround

Explicitly provide files without file extension to alex:

podman run -it --rm --volume "$(pwd):/alex:ro,z" --workdir "/alex" registry.gitlab.com/pipeline-components/alex:0.21.9 --why README

But this will not work when .alexignore is defined:

echo "README" > .alexignore

It returns status code 1 and prints:

README
  1:1  error  Cannot process specified file: it’s ignored

✖ 1 error

Related issues

wooorm commented 1 year ago

Hi!

It is intentional that files without extensions, which could include any code, or be for example binary files, are not included by default.

If you want to include certain files, pass them: alex whatever