diff --git a/.github/workflows/glualint.yml b/.github/workflows/glualint.yml new file mode 100644 index 0000000..6c6f0df --- /dev/null +++ b/.github/workflows/glualint.yml @@ -0,0 +1,17 @@ +name: GLuaLint + +on: + push: + paths: + - 'lua/**' + - '!lua/entities/gmod_wire_expression2/**' + pull_request: + paths: + - 'lua/**' + - '!lua/entities/gmod_wire_expression2/**' + +jobs: + Lint: + uses: FPtje/GLuaFixer/.github/workflows/glualint.yml@master + with: + config: "./.glualint.json" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/workshop-upload.yml similarity index 81% rename from .github/workflows/main.yml rename to .github/workflows/workshop-upload.yml index ed6e95e..873a8eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/workshop-upload.yml @@ -12,9 +12,9 @@ jobs: - uses: CFC-Servers/gmod-upload@master with: id: 3154971187 - changelog: "Deployment via Github to latest changes" + changelog: "${{ github.event.head_commit.message }}" title: "Contraption Framework" - type: "ServerContent" + type: "tool" tag1: "build" env: STEAM_USERNAME: ${{ secrets.ACF_STEAM_ACCOUNT }} diff --git a/.glualint.json b/.glualint.json new file mode 100644 index 0000000..b0d93a2 --- /dev/null +++ b/.glualint.json @@ -0,0 +1,33 @@ +{ + "lint_maxScopeDepth": 10, + "lint_syntaxErrors": true, + "lint_syntaxInconsistencies": true, + "lint_deprecated": true, + "lint_trailingWhitespace": true, + "lint_whitespaceStyle": true, + "lint_beginnerMistakes": true, + "lint_emptyBlocks": true, + "lint_shadowing": false, + "lint_gotos": true, + "lint_doubleNegations": true, + "lint_redundantIfStatements": true, + "lint_redundantParentheses": true, + "lint_duplicateTableKeys": true, + "lint_profanity": true, + "lint_unusedVars": true, + "lint_unusedParameters": true, + "lint_unusedLoopVars": true, + "lint_ignoreFiles": ["lua/entities/gmod_wire_expression2/core/custom/*.lua"], + + "prettyprint_spaceAfterParens": false, + "prettyprint_spaceAfterBrackets": false, + "prettyprint_spaceAfterBraces": false, + "prettyprint_spaceAfterLabel": false, + "prettyprint_spaceBeforeComma": false, + "prettyprint_spaceAfterComma": true, + "prettyprint_semicolons": false, + "prettyprint_cStyle": false, + "prettyprint_rejectInvalidCode": false, + "prettyprint_indentation": "\t", + "log_format": "auto" +} diff --git a/lua/cfw/core/connectivity_sv.lua b/lua/cfw/core/connectivity_sv.lua index 1e0248c..de58a87 100644 --- a/lua/cfw/core/connectivity_sv.lua +++ b/lua/cfw/core/connectivity_sv.lua @@ -4,7 +4,7 @@ local function floodFill(source, sinkIndex) local open = source:GetLinks() while next(open) do - local entIndex, entLink = next(open) + local entIndex = next(open) -- entIndex, entLink open[entIndex] = nil closed[entIndex] = true @@ -13,7 +13,7 @@ local function floodFill(source, sinkIndex) if entIndex == sinkIndex then return true, closed end - for neighborIndex, neighborLink in pairs(Entity(entIndex)._links) do + for neighborIndex, _ in pairs(Entity(entIndex)._links) do -- neighborIndex, neighborLink if not closed[neighborIndex] then open[neighborIndex] = true end