Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic linting with GitHub Actions #28

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .cc-tweaked.selene.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
base: lua52

globals:
package.cpath:
removed: true
collectgarbage:
removed: true
_HOST:
property: read-only
_CC_DEFAULT_SETTINGS:
property: read-only
_CC_DISABLE_LUA51_FEATURES:
property: read-only
sleep:
property: read-only
args:
- type: number
required: true
write:
property: read-only
args:
- type: string
required: true
printError:
property: read-only
args:
- type: "..."
required: true
read:
property: read-only
args:
- type: string
required: false
- type: table
required: false
- type: function
required: false
- type: string
required: false
colors:
property: read-only
colours:
property: read-only
commands:
property: read-only
disk:
property: read-only
fs:
property: read-only
gps:
property: read-only
help:
property: read-only
http:
property: read-only
io:
property: read-only
keys:
property: read-only
multishell:
property: read-only
os:
property: read-only
paintutils:
property: read-only
parallel:
property: read-only
peripheral:
property: read-only
pocket:
property: read-only
rednet:
property: read-only
redstone:
property: read-only
settings:
property: read-only
shell:
property: read-only
term:
property: read-only
textutils:
property: read-only
turtle:
property: read-only
vector:
property: read-only
window:
property: read-only
27 changes: 27 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Linting

on:
push:
paths: ["**.lua", ".github/workflows/lint.yaml"]
pull_request:
paths: ["**.lua", ".github/workflows/lint.yaml"]
workflow_dispatch:

jobs:
lint-selene:
name: Lint Lua with Selene
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: NTBBloodbath/selene-action@v1.0.0
with:
# Github secret token
token: ${{ secrets.GITHUB_TOKEN }}
# selene arguments
args: . --config .selene.toml
# selene version
version: 0.23.1

5 changes: 5 additions & 0 deletions .selene.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
std = ".cc-tweaked.selene"
exclude = ["./unicorn/semver.lua"]

[lints]
incorrect_standard_library_use = "allow" # Workaround for https://github.com/Kampfkarren/selene/issues/467