1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-16 10:09:55 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Jonathan Coates
ef8da8054f
An initial stab at documentation generation (#360)
This adds documentation comments to many of CC's Lua APIs, and
a couple of the Java ones, through the use of stubs. We then
export these to HTML using illuaminate [1] and upload them to our
documentation site [2].

Uploads currently occur on pushes to master and any release/tag. The
site is entirely static - there is no way to switch between versions,
etc... but hopefully we can improve this in the future.

[1]: github.com/SquidDev/illuaminate/
[2]: https://tweaked.cc/
2020-04-10 10:27:53 +01:00
Jonathan Coates
fa70ebcac2
Fix spacing on all of the rom (#323) 2019-12-07 10:33:47 +00:00
SquidDev
86e0330100 Lint bios and the rom (#321)
We now use illuaminate[1]'s linting facilities to check the rom and
bios.lua for a couple of common bugs and other problems.

Right now this doesn't detect any especially important bugs, though it
has caught lots of small things (unused variables, some noisy code). In
the future, the linter will grow in scope and features, which should
allow us to be stricter and catch most issues.

As a fun aside, we started off with ~150 bugs, and illuaminate was able
to fix all but 30 of them, which is pretty neat.

[1]: https://github.com/SquidDev/illuaminate
2019-12-03 23:26:13 +00:00
SquidDev
93310850d2 Use the "cc" module namespace instead of "craftos"
This is what we actually discussed in the issue, and I failed to
remember.
2019-07-27 11:34:59 +01:00
SquidDev
bafab1ac07
Expose expect as a module (#267)
This moves expect from the bios into a new craftos.expect module,
removing the internal _G["~expect"] definition. Apparently people were
using this irrespective of the "don't use this" comment, so we need to
find another solution.

While this does introduce some ugliness (having to load the module in
weird ways for programs, duplicating the expect function in memory), it
does allow people to use the function in a supported way, and removes
the global ugliness.
2019-07-09 08:04:49 +01:00
hydraz
9048deeb95 Add a function for type-checking arguments (#207)
- Define an expect(index, actual_value, types...) helper function which
   takes an argument index, value and list of permissable types and
   ensures the value is of one of those types.
   If not, it will produce an error message with the expected and actual
   type, as well as the argument number and (if available) the function
   name.
 - Expose expect in the global scope as _G["~expect"], hopefully making
   it clear it is internal.
 - Replace most manual type checks with this helper method.
 - Write tests to ensure this argument validation works as expected

Also fix a couple of bugs exposed by this refactor and the subsequent
tests:
 - Make rednet checks a little more strict - rednet.close(false) is no
   longer valid.
 - Error when attempting to redirect the terminal to itself 
   (term.redirect(term)).
2019-05-30 19:36:28 +01:00
SquidDev
86569533e9 The big massive reformat
- Normalise all line endings to be LF rather than CLRF
 - Trim all trailing whitespace
 - Remove any tabs
2018-12-17 18:09:31 +00:00
SquidDev
12abd4292e Fixes a non-existent method being used in paintutils 2017-09-12 09:52:21 +01:00
Daniel Ratcliffe
1fdfcdb5f2 Merge pull request #378 from MineRobber9000/patch-3
Add ability to load raw data from a string [paintutils]
2017-09-11 13:28:27 +01:00
Wojbie
4c89364964 Requested changes 2017-07-25 21:01:04 +02:00
MineRobber___T
2c91c7962f Remove unused tImage table and slightly clean code 2017-07-17 01:49:14 -04:00
MineRobber___T
f785b0a488 Update paintutils.lua 2017-07-17 01:16:36 -04:00
MineRobber___T
af847818d2 Remove some context from comment
I agree with SquidDev, I went a bit too far with the whole context thing.
2017-07-16 02:10:42 -04:00
MineRobber___T
ee20d7bed2 Fix line split
Also fixes a typo.
2017-07-16 02:08:54 -04:00
MineRobber___T
11060596b1 Remove legacy bHandleRawData check and fix file loading
While the check (most likely) wouldn't break anything, it's better to fix it and not worry then to not fix it and find out it breaks image loading. Also fixes how files are loaded.
2017-07-15 18:31:42 -04:00
MineRobber___T
71d024a76c Move raw data parsing to paintutils.drawImage 2017-07-15 18:27:52 -04:00
MineRobber___T
260bb2e4e1 Add ability to load raw data from a string 2017-07-15 17:50:05 -04:00
SquidDev
e664eb26a9 Fix several global definitions
There were a couple of programs which were defining global variables, or
referencing undefined ones. This fixes all problems in the main rom files.
2017-07-08 11:31:30 +00:00
Bomb Bloke
a7db108762 Update paintutils.lua 2017-06-19 13:46:13 +10:00
SquidDev
fac625173a Use Lua style error messages in the rom files
This makes it mostly consistent with the Java APIs, and makes debugging
significantly easier.
2017-06-12 10:54:44 +01:00
Daniel Ratcliffe
6e6b8e7eef Made os.loadAPI handle .lua files. Renamed all builtin APIs to .lua 2017-05-17 22:47:13 +01:00