FPtje / GLuaFixer

Linter for Garry's mod Lua.
https://fptje.github.io/glualint-web/
GNU Lesser General Public License v2.1
142 stars 19 forks source link

`lint_ignoreFiles` parameter not working as described #136

Closed FlorianLeChat closed 2 years ago

FlorianLeChat commented 2 years ago

In the linter parameters, it says "Files to ignore when linting. You can use glob patterns (e.g. "*.lua" or libraries/*.lua)", after trying to setup my workspace to ignore some files, it seems this parameter is ignored or is not working as intended. To illustrate this issue, here is the structure of my test workspace tree:

test/ .glualint.json

a/

b/

test_b.lua

c/

test_c.lua

I have two Lua files containing:

// Test
-- test
print("Test")

Here is the GLuaLint configuration at the root of my workspace:

{
    "lint_maxScopeDepth": 7,
    "lint_syntaxErrors": true,
    "lint_syntaxInconsistencies": true,
    "lint_deprecated": true,
    "lint_trailingWhitespace": true,
    "lint_whitespaceStyle": true,
    "lint_beginnerMistakes": true,
    "lint_emptyBlocks": true,
    "lint_shadowing": true,
    "lint_gotos": true,
    "lint_goto_identifier": true,
    "lint_doubleNegations": true,
    "lint_redundantIfStatements": true,
    "lint_redundantParentheses": true,
    "lint_duplicateTableKeys": true,
    "lint_profanity": true,
    "lint_unusedVars": true,
    "lint_unusedParameters": false,
    "lint_unusedLoopVars": true,
    "lint_inconsistentVariableStyle": false,
    "lint_spaceAfterParens": false,
    "lint_spaceAfterBrackets": false,
    "lint_spaceAfterBraces": false,
    "lint_ignoreFiles": ["*.lua"], <-- All Lua files should be ignored (?)

    "prettyprint_spaceAfterParens": false,
    "prettyprint_spaceAfterBrackets": false,
    "prettyprint_spaceAfterBraces": false,
    "prettyprint_spaceEmptyParens": false,
    "prettyprint_spaceEmptyBrackets": true,
    "prettyprint_spaceAfterLabel": false,
    "prettyprint_spaceBeforeComma": false,
    "prettyprint_spaceAfterComma": true,
    "prettyprint_semicolons": false,
    "prettyprint_cStyle": false,
    "prettyprint_removeRedundantParens": true,
    "prettyprint_minimizeParens": true,
    "prettyprint_assumeOperatorAssociativity": true,
    "prettyprint_rejectInvalidCode": false,
    "prettyprint_indentation": "    ",

    "log_format": "auto"
}

Using VSCode or using the executable through the command prompt (glualint.exe --config "<path_to_test_folder>\.glualint.json" lint "<path_to_test_folder>"), GLuaFixer keeps showing me warnings about inconsistencies between the C and Lua comments.

This issue is even more annoying because I'm using GLuaFixer with GitHub Actions in a repository containing code which shouldn't be linted or altered for every push or pull request. For information, I did my tests on Windows with the latest version and on GitHub using the instructions from here.

I hope I have been sufficiently explanatory and I am ready to give more information if needed. I still don't understand why such a simple thing doesn't work so if it's a mistake on my side, I'm really sorry! 😭

wrefgtzweve commented 2 years ago

Having this issue too, stuff like E2 libs don't work well with my automated workflow as they use their own formatting. Example https://github.com/wiremod/wire/blob/147b817eb5af602bd49f4494505fb80bb40e3030/lua/entities/gmod_wire_expression2/core/chat.lua#L51

FPtje commented 2 years ago

There were two problems here:

I've also added **.lua to the example, so people start wondering what the difference between *.lua and **.lua is.