vale icon indicating copy to clipboard operation
vale copied to clipboard

Ignore `#!/...` shebang on first line of code files

Open rpatterson opened this issue 2 years ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the feature

Currently, vale process a #!/... shebang on the first line of a code file as a comment. For example, when run on a Python script with a first line of #!/usr/bin/env python3, vale produces the following error:

 1:12   error       Use 'environment' rather than   RedHat.TermsErrors      
                    'env'.                                                   

In terms of being syntax aware, a shebang line should not be considered a comment. Add an exception to the logic that identifies comments to exclude comments starting with !/ if that comment is on the first line.

rpatterson avatar May 16 '23 00:05 rpatterson

$ docker compose run --rm vale --version
vale version v2.26.0

rpatterson avatar May 16 '23 01:05 rpatterson