CC-Tweaked/illuaminate.sexp

117 lines
3.3 KiB
Plaintext
Raw Permalink Normal View History

; -*- mode: Lisp;-*-
(sources
/doc/
/build/docs/luaJavadoc/
/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/
/src/test/resources/test-rom
/src/web/mount)
(doc
(destination build/illuaminate)
(index doc/index.md)
(site
(title "CC: Tweaked")
(logo src/main/resources/pack.png)
(url https://tweaked.cc/)
(source-link https://github.com/cc-tweaked/CC-Tweaked/blob/${commit}/${path}#L${line})
(styles src/web/styles.css)
(scripts build/rollup/index.js)
(head doc/head.html))
(module-kinds
(peripheral Peripherals)
(generic_peripheral "Generic Peripherals")
(event Events)
(guide Guides)
(reference Reference))
(library-path
/doc/stub/
/build/docs/luaJavadoc/
/src/main/resources/*/computercraft/lua/rom/apis/
/src/main/resources/*/computercraft/lua/rom/apis/command/
/src/main/resources/*/computercraft/lua/rom/apis/turtle/
/src/main/resources/*/computercraft/lua/rom/modules/main/
/src/main/resources/*/computercraft/lua/rom/modules/command/
/src/main/resources/*/computercraft/lua/rom/modules/turtle/))
(at /
(linters
syntax:string-index
2019-12-10 18:54:43 +00:00
;; It'd be nice to avoid this, but right now there's a lot of instances of
;; it.
-var:set-loop
;; It's useful to name arguments for documentation, so we allow this. It'd
;; be good to find a compromise in the future, but this works for now.
-var:unused-arg)
2020-02-04 16:41:29 +00:00
(lint
(bracket-spaces
(call no-space)
(function-args no-space)
(parens no-space)
(table space)
(index no-space))
(allow-clarifying-parens true)
;; colours imports from colors, and we don't handle that right now.
;; keys is entirely dynamic, so we skip it.
2020-10-11 21:38:18 +00:00
(dynamic-modules colours keys _G)
(globals
:max
_CC_DEFAULT_SETTINGS
_CC_DISABLE_LUA51_FEATURES
_HOST
;; Ideally we'd pick these up from bios.lua, but illuaminate currently
;; isn't smart enough.
sleep write printError read rs)))
2019-12-10 18:54:43 +00:00
;; We disable the unused global linter in bios.lua and the APIs. In the future
;; hopefully we'll get illuaminate to handle this.
(at
(/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/apis/)
2019-12-10 18:54:43 +00:00
(linters -var:unused-global)
(lint (allow-toplevel-global true)))
;; Silence some variable warnings in documentation stubs.
(at (/doc/stub/ /build/docs/luaJavadoc/)
(linters -var:unused-global)
(lint (allow-toplevel-global true)))
;; Suppress warnings for currently undocumented modules.
(at
(; Lua APIs
/src/main/resources/*/computercraft/lua/rom/apis/io.lua
/src/main/resources/*/computercraft/lua/rom/apis/window.lua)
Generate documentation stubs from Javadocs illuaminate does not handle Java files, for obvious reasons. In order to get around that, we have a series of stub files within /doc/stub which mirrored the Java ones. While this works, it has a few problems: - The link to source code does not work - it just links to the stub file. - There's no guarantee that documentation remains consistent with the Java code. This change found several methods which were incorrectly documented beforehand. We now replace this with a custom Java doclet[1], which extracts doc comments from @LuaFunction annotated methods and generates stub-files from them. These also contain a @source annotation, which allows us to correctly link them back to the original Java code. There's some issues with this which have yet to be fixed. However, I don't think any of them are major blockers right now: - The custom doclet relies on Java 9 - I think it's /technically/ possible to do this on Java 8, but the API is significantly uglier. This means that we need to run javadoc on a separate JVM. This is possible, and it works locally and on CI, but is definitely not a nice approach. - illuaminate now requires the doc stubs to be generated in order for the linter to pass, which does make running the linter locally much harder (especially given the above bullet point). We could notionally include the generated stubs (or at least a cut down version of them) in the repo, but I'm not 100% sure about that. [1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
(linters -doc:undocumented -doc:undocumented-arg -doc:undocumented-return))
;; Suppress warnings for various APIs using its own deprecated members.
(at
(/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/apis/turtle/turtle.lua)
2020-10-11 21:38:18 +00:00
(linters -var:deprecated))
(at /src/test/resources/test-rom
2020-08-04 18:50:36 +00:00
; We should still be able to test deprecated members.
(linters -var:deprecated)
(lint
(globals
:max sleep write
Cherry pick several changes back from 1.19.3 The main purpose of this is to backport the improved parse/runtime errors to older versions. I think they're sufficiently useful that we should try to make it as widely available as possible. We've been running them for a week now on SC3 and the released version and not seen any issues, so I think it's probably stable enough. This is a pretty lazy commit: I ended up copying the whole ROM over and then picking up a few other related changes along the way. - Trim spaces from file paths (b8fce1eecccae652d1128fcf50b57a09eda69dca) - Correctly format 12AM/PM with %I (9f48395596131a932fbc37644fe1e4b15ffb6a61) - Fix http.request and htpt.websocketAsync not handling a few failure edge-cases correctly (3b42f22a4f36dad0c53bb238e64aada352a063cf). - Move the internal modules into the main package path, hidden under cc.internal (34a31abd9ce9106b84549ade2cc30524016107c9). - Gather code coverage in Java instead of Lua (28a55349a961c0739adc9d52fc3761c463678be9). - Make error messages in edit more obvious (8cfbfe7ceb35e87579b4f6fe8c892e6bce9ed0eb). - Make mcfly's test methods global. This means we don't need to pass stub everywhere (7335a892b5742f7879a4ca07f059cd7b8136aa3a). - Improve runtime and parse errors. This comes from numerous commits, but chiefly a12b405acfb63d58d6a895e8a8a139ef5c42fbfc, and 55024121817bb112ea68d30e7cb5511a16ccfc94. - Hide the internal redirect methods in multishell (33b6f383397d51074bd504a4067253ae65f5b77c). Note this does /not/ include the shebang changes (sorry Emma!). I've tried to avoid adding any user-controllable features, mostly because I don't know how to handle the versioning otherwise :).
2023-02-14 09:45:02 +00:00
cct_test describe expect howlci fail it pending stub before_each)))
(at /src/web/mount/expr_template.lua (lint (globals :max __expr__)))