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

Error mixed table #586

Merged
merged 10 commits into from
Feb 24, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased](https://github.com/Kampfkarren/selene/compare/0.26.1...HEAD)
### Added
- Added `CFrame.lookAlong` to the Roblox standard library
- When a mixed table is detected, selene will now tell you why mixed tables are bad and that they should be avoided
chriscerie marked this conversation as resolved.
Show resolved Hide resolved

## [0.26.1](https://github.com/Kampfkarren/selene/releases/tag/0.26.1) - 2023-11-11
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion selene-lib/src/lints/mixed_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Lint for MixedTableLint {
for mixed_table in visitor.mixed_tables {
diagnostics.push(Diagnostic::new_complete(
"mixed_table",
"mixed tables are not allowed".to_owned(),
"mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging".to_owned(),
Midnightific marked this conversation as resolved.
Show resolved Hide resolved
Label::new(mixed_table.range),
vec!["help: change this table to either an array or dictionary".to_owned()],
Vec::new(),
Expand Down
12 changes: 6 additions & 6 deletions selene-lib/tests/lints/mixed_table/mixed_table.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:2:5
2 │ ╭ "",
Expand All @@ -7,7 +7,7 @@ error[mixed_table]: mixed tables are not allowed
= help: change this table to either an array or dictionary

error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:7:5
7 │ ╭ {},
Expand All @@ -16,7 +16,7 @@ error[mixed_table]: mixed tables are not allowed
= help: change this table to either an array or dictionary

error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:12:5
12 │ ╭ a,
Expand All @@ -25,7 +25,7 @@ error[mixed_table]: mixed tables are not allowed
= help: change this table to either an array or dictionary

error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:19:5
19 │ ╭ 1,
Expand All @@ -34,7 +34,7 @@ error[mixed_table]: mixed tables are not allowed
= help: change this table to either an array or dictionary

error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:25:5
25 │ ╭ [c] = d,
Expand All @@ -43,7 +43,7 @@ error[mixed_table]: mixed tables are not allowed
= help: change this table to either an array or dictionary

error[mixed_table]: mixed tables are not allowed
error[mixed_table]: mixed tables are heavily discouraged due to factors such as: type safety, readability, compatibility, and debugging
┌─ mixed_table.lua:30:5
30 │ ╭ a = b,
Expand Down
Loading