sasjs / lint

Linting and formatting for SAS® code

Home Page:https://sasjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.sasjslint has no effect

rudvfaden opened this issue · comments

I have ~/.sasjslint and a sas program in the same folder. But I still get 'Line is indented with a tab'. Any ideas?

{
    "noEncodedPasswords": true,
    "hasDoxygenHeader": true,
    "hasMacroNameInMend": true,
    "hasMacroParentheses": false,
    "indentationMultiple": 2,
    "lowerCaseFileNames": false,
    "maxLineLength": 80,
    "noNestedMacros": true,
    "noSpacesInFileNames": true,
    "noTabIndentation": false,
    "noTrailingSpaces": true
}

I still get this error

image

Running on a remote host!

Hi @rudvfaden - after some testing, I am able to reproduce this - it happens when .sasjslint is not in the root of the project:

Untitled_.Jun.15.2022.9_43.AM.mp4

The VS Code extension works 'project wide' hence it takes one sasjslint file and applies it everywhere, and the place we pick it up from is the project root. The documentation (README) does mention this: https://github.com/sasjs/vscode-extension#sas-lint-and-format

That said, I also tested the CLI and found that this does not recognise a root level .sasjslint file:

Untitled_.Jun.15.2022.9_54.AM.mp4

I'll raise an issue for this on the CLI repo

Hi Allan. What defines the 'root' I would believe that ~/ was a root folder. s it the workspace root? What if you have several folders in your workspaces?

Hi Rud,

Yes - it's the workspace root. I haven't tested this on multi-root workspaces but it should work the same..

The number of folders in a workspace is not relevant from a VS Code linting perspective, the .sasjslint file must be in the workspace root.

So if you want to apply a different lint to a subfolder (using VS Code) then you should open an instance in that folder. More info here: https://code.visualstudio.com/docs/editor/workspaces

It seems like code that existed before the creation of the .sasjslint file still confoms to the old rule.
line 14-20 existed before and line 22-28 i just typed.
image

Hi @rudvfaden - the linter is applied when saving the file - if you can include the VS Code title bar in future screenshots, it will show us the save state (filled in circle by the filename if not saved)

EDIT - I'm wrong about that. I can't reproduce your behaviour. Can you highlight the code and demonstrate that the blank spaces definitely don't have tabs?

Hi @allanbowe . The error seems to be gone know. Maybe it just took some time to take effekt

Great stuff!