From a38a7bf349b7f54e600fb3ed24668da7ce709746 Mon Sep 17 00:00:00 2001 From: Micah Date: Wed, 8 Nov 2023 09:34:02 -0800 Subject: [PATCH 1/2] Add bit32.byteswap to Luau standard library (#567) Adds bit32.byteswap to the Luau standard library. --- CHANGELOG.md | 1 + selene-lib/default_std/luau.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6015620..bcee94f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Added `no-exclude` cli flag to disable excludes. - When given in standard library format, additional information now shows up in `incorrect_standard_library_use` missing required parameter errors. - Added new [`mixed_table` lint](https://kampfkarren.github.io/selene/lints/mixed_table.html), which will warn against mixed tables. +- Added `bit32.byteswap` to Luau standard library ### Fixed - `string.pack` and `string.unpack` now have proper function signatures in the Lua 5.3 standard library. diff --git a/selene-lib/default_std/luau.yml b/selene-lib/default_std/luau.yml index 8d41cb45..c4077b56 100644 --- a/selene-lib/default_std/luau.yml +++ b/selene-lib/default_std/luau.yml @@ -29,6 +29,10 @@ globals: args: - type: "..." must_use: true + bit32.byteswap: + args: + - type: number + must_use: true bit32.countlz: args: - type: number From 92afa63e6e9477f5e148e424a0c144cfce82e614 Mon Sep 17 00:00:00 2001 From: Micah Date: Wed, 8 Nov 2023 10:35:08 -0800 Subject: [PATCH 2/2] Add buffer library to Luau standard library (#566) This adds the buffer library to the Luau standard library. I tried my best to sort them in alphabetical order but it was done by hand, so there's a chance I made a mistake. --- CHANGELOG.md | 1 + selene-lib/default_std/luau.yml | 148 ++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcee94f9..0ddc0eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - When given in standard library format, additional information now shows up in `incorrect_standard_library_use` missing required parameter errors. - Added new [`mixed_table` lint](https://kampfkarren.github.io/selene/lints/mixed_table.html), which will warn against mixed tables. - Added `bit32.byteswap` to Luau standard library +- Added `buffer` library to Luau standard library ### Fixed - `string.pack` and `string.unpack` now have proper function signatures in the Lua 5.3 standard library. diff --git a/selene-lib/default_std/luau.yml b/selene-lib/default_std/luau.yml index c4077b56..0243c110 100644 --- a/selene-lib/default_std/luau.yml +++ b/selene-lib/default_std/luau.yml @@ -76,6 +76,154 @@ globals: - type: number - type: number must_use: true + buffer.copy: + args: + - type: + display: buffer + - type: number + - type: + display: buffer + - required: false + type: number + - required: false + type: number + buffer.create: + args: + - type: number + must_use: true + buffer.fill: + args: + - type: + display: buffer + - type: number + - type: number + - required: false + type: number + buffer.fromstring: + args: + - type: string + must_use: true + buffer.len: + args: + - type: + display: buffer + must_use: true + buffer.readf32: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readf64: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readi8: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readi16: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readi32: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readstring: + args: + - type: + display: buffer + - type: number + - type: number + must_use: true + buffer.readu8: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readu16: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.readu32: + args: + - type: + display: buffer + - type: number + must_use: true + buffer.tostring: + args: + - type: + display: buffer + must_use: true + buffer.writef32: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writef64: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writei8: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writei16: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writei32: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writestring: + args: + - type: + display: buffer + - type: number + - type: string + - required: false + type: number + buffer.writeu8: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writeu16: + args: + - type: + display: buffer + - type: number + - type: number + buffer.writeu32: + args: + - type: + display: buffer + - type: number + - type: number collectgarbage: args: - type: