Skip to content

Commit fd394ee

Browse files
authored
Merge pull request #1462 from armbrmaSICKAG/diagnostics-descriptions
Missing descriptions for diagnostics
2 parents 82bcfef + 95a4dc5 commit fd394ee

File tree

8 files changed

+516
-0
lines changed

8 files changed

+516
-0
lines changed

doc/en-us/config.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Array<string>
190190

191191
* ``"action-after-return"``
192192
* ``"ambiguity-1"``
193+
* ``"ambiguous-syntax"``
193194
* ``"args-after-dots"``
194195
* ``"assign-type-mismatch"``
195196
* ``"await-in-sync"``
@@ -654,26 +655,74 @@ object<string, string>
654655
Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.
655656
*/
656657
"ambiguity-1": "Any",
658+
/*
659+
Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable.
660+
*/
657661
"assign-type-mismatch": "Opened",
662+
/*
663+
Enable diagnostics for calls of asynchronous functions within a synchronous function.
664+
*/
658665
"await-in-sync": "None",
666+
/*
667+
Enable diagnostics for casts of local variables where the target type does not match the defined type.
668+
*/
659669
"cast-local-type": "Opened",
670+
/*
671+
Enable diagnostics for casts where the target type does not match the initial type.
672+
*/
660673
"cast-type-mismatch": "Opened",
661674
"circle-doc-class": "Any",
675+
/*
676+
Enable diagnostics for attempts to close a variable with a non-object.
677+
*/
662678
"close-non-object": "Any",
679+
/*
680+
Enable diagnostics for code placed after a break statement in a loop.
681+
*/
663682
"code-after-break": "Opened",
683+
/*
684+
Enable diagnostics for incorrectly styled lines.
685+
*/
664686
"codestyle-check": "None",
687+
/*
688+
Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.
689+
*/
665690
"count-down-loop": "Any",
691+
/*
692+
Enable diagnostics to highlight deprecated API.
693+
*/
666694
"deprecated": "Any",
695+
/*
696+
Enable diagnostics for files which are required by two different paths.
697+
*/
667698
"different-requires": "Any",
699+
/*
700+
Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.
701+
*/
668702
"discard-returns": "Any",
703+
/*
704+
Enable diagnostics to highlight a field annotation without a defining class annotation.
705+
*/
669706
"doc-field-no-class": "Any",
707+
/*
708+
Enable diagnostics for a duplicated alias annotation name.
709+
*/
670710
"duplicate-doc-alias": "Any",
711+
/*
712+
Enable diagnostics for a duplicated field annotation name.
713+
*/
671714
"duplicate-doc-field": "Any",
715+
/*
716+
Enable diagnostics for a duplicated param annotation name.
717+
*/
672718
"duplicate-doc-param": "Any",
673719
/*
674720
Enable duplicate table index diagnostics.
675721
*/
676722
"duplicate-index": "Any",
723+
/*
724+
Enable diagnostics for setting the same field in a class more than once.
725+
*/
677726
"duplicate-set-field": "Any",
678727
/*
679728
Enable empty code block diagnostics.
@@ -687,9 +736,21 @@ object<string, string>
687736
Enable lowercase global variable definition diagnostics.
688737
*/
689738
"lowercase-global": "Any",
739+
/*
740+
Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.
741+
*/
690742
"missing-parameter": "Any",
743+
/*
744+
Enable diagnostics for functions with return annotations which have no return statement.
745+
*/
691746
"missing-return": "Any",
747+
/*
748+
Enable diagnostics for return statements without values although the containing function declares returns.
749+
*/
692750
"missing-return-value": "Any",
751+
/*
752+
Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.
753+
*/
693754
"need-check-nil": "Opened",
694755
/*
695756
Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.
@@ -699,8 +760,17 @@ object<string, string>
699760
Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.
700761
*/
701762
"newline-call": "Any",
763+
/*
764+
Enable diagnostics for cases in which the type cannot be inferred.
765+
*/
702766
"no-unknown": "None",
767+
/*
768+
Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.
769+
*/
703770
"not-yieldable": "None",
771+
/*
772+
Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.
773+
*/
704774
"param-type-mismatch": "Opened",
705775
/*
706776
Enable redefined local variable diagnostics.
@@ -710,34 +780,73 @@ object<string, string>
710780
Enable redundant function parameter diagnostics.
711781
*/
712782
"redundant-parameter": "Any",
783+
/*
784+
Enable diagnostics for return statements which are not needed because the function would exit on its own.
785+
*/
713786
"redundant-return": "Opened",
787+
/*
788+
Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.
789+
*/
714790
"redundant-return-value": "Any",
715791
/*
716792
Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.
717793
*/
718794
"redundant-value": "Any",
795+
/*
796+
Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.
797+
*/
719798
"return-type-mismatch": "Opened",
799+
/*
800+
Enable diagnostics for typos in strings.
801+
*/
720802
"spell-check": "None",
721803
/*
722804
Enable trailing space diagnostics.
723805
*/
724806
"trailing-space": "Opened",
807+
/*
808+
Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).
809+
*/
725810
"unbalanced-assignments": "Any",
811+
/*
812+
Enable diagnostics for class annotations in which an undefined class is referenced.
813+
*/
726814
"undefined-doc-class": "Any",
815+
/*
816+
Enable diagnostics for type annotations referencing an undefined type or alias.
817+
*/
727818
"undefined-doc-name": "Any",
819+
/*
820+
Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.
821+
*/
728822
"undefined-doc-param": "Any",
729823
/*
730824
Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.
731825
*/
732826
"undefined-env-child": "Any",
827+
/*
828+
Enable diagnostics for cases in which an undefined field of a variable is read.
829+
*/
733830
"undefined-field": "Opened",
734831
/*
735832
Enable undefined global variable diagnostics.
736833
*/
737834
"undefined-global": "Any",
835+
/*
836+
Enable diagnostics for casts of undefined variables.
837+
*/
738838
"unknown-cast-variable": "Any",
839+
/*
840+
Enable diagnostics in cases in which an unknown diagnostics code is entered.
841+
*/
739842
"unknown-diag-code": "Any",
843+
/*
844+
Enable diagnostics for unknown operators.
845+
*/
740846
"unknown-operator": "Any",
847+
/*
848+
Enable diagnostics for unreachable code.
849+
*/
741850
"unreachable-code": "Opened",
742851
/*
743852
Enable unused function diagnostics.
@@ -790,26 +899,74 @@ object<string, string>
790899
Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead.
791900
*/
792901
"ambiguity-1": "Warning",
902+
/*
903+
Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable.
904+
*/
793905
"assign-type-mismatch": "Warning",
906+
/*
907+
Enable diagnostics for calls of asynchronous functions within a synchronous function.
908+
*/
794909
"await-in-sync": "Warning",
910+
/*
911+
Enable diagnostics for casts of local variables where the target type does not match the defined type.
912+
*/
795913
"cast-local-type": "Warning",
914+
/*
915+
Enable diagnostics for casts where the target type does not match the initial type.
916+
*/
796917
"cast-type-mismatch": "Warning",
797918
"circle-doc-class": "Warning",
919+
/*
920+
Enable diagnostics for attempts to close a variable with a non-object.
921+
*/
798922
"close-non-object": "Warning",
923+
/*
924+
Enable diagnostics for code placed after a break statement in a loop.
925+
*/
799926
"code-after-break": "Hint",
927+
/*
928+
Enable diagnostics for incorrectly styled lines.
929+
*/
800930
"codestyle-check": "Warning",
931+
/*
932+
Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.
933+
*/
801934
"count-down-loop": "Warning",
935+
/*
936+
Enable diagnostics to highlight deprecated API.
937+
*/
802938
"deprecated": "Warning",
939+
/*
940+
Enable diagnostics for files which are required by two different paths.
941+
*/
803942
"different-requires": "Warning",
943+
/*
944+
Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.
945+
*/
804946
"discard-returns": "Warning",
947+
/*
948+
Enable diagnostics to highlight a field annotation without a defining class annotation.
949+
*/
805950
"doc-field-no-class": "Warning",
951+
/*
952+
Enable diagnostics for a duplicated alias annotation name.
953+
*/
806954
"duplicate-doc-alias": "Warning",
955+
/*
956+
Enable diagnostics for a duplicated field annotation name.
957+
*/
807958
"duplicate-doc-field": "Warning",
959+
/*
960+
Enable diagnostics for a duplicated param annotation name.
961+
*/
808962
"duplicate-doc-param": "Warning",
809963
/*
810964
Enable duplicate table index diagnostics.
811965
*/
812966
"duplicate-index": "Warning",
967+
/*
968+
Enable diagnostics for setting the same field in a class more than once.
969+
*/
813970
"duplicate-set-field": "Warning",
814971
/*
815972
Enable empty code block diagnostics.
@@ -823,9 +980,21 @@ object<string, string>
823980
Enable lowercase global variable definition diagnostics.
824981
*/
825982
"lowercase-global": "Information",
983+
/*
984+
Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.
985+
*/
826986
"missing-parameter": "Warning",
987+
/*
988+
Enable diagnostics for functions with return annotations which have no return statement.
989+
*/
827990
"missing-return": "Warning",
991+
/*
992+
Enable diagnostics for return statements without values although the containing function declares returns.
993+
*/
828994
"missing-return-value": "Warning",
995+
/*
996+
Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.
997+
*/
829998
"need-check-nil": "Warning",
830999
/*
8311000
Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.
@@ -835,8 +1004,17 @@ object<string, string>
8351004
Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.
8361005
*/
8371006
"newline-call": "Warning",
1007+
/*
1008+
Enable diagnostics for cases in which the type cannot be inferred.
1009+
*/
8381010
"no-unknown": "Warning",
1011+
/*
1012+
Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.
1013+
*/
8391014
"not-yieldable": "Warning",
1015+
/*
1016+
Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.
1017+
*/
8401018
"param-type-mismatch": "Warning",
8411019
/*
8421020
Enable redefined local variable diagnostics.
@@ -846,34 +1024,73 @@ object<string, string>
8461024
Enable redundant function parameter diagnostics.
8471025
*/
8481026
"redundant-parameter": "Warning",
1027+
/*
1028+
Enable diagnostics for return statements which are not needed because the function would exit on its own.
1029+
*/
8491030
"redundant-return": "Hint",
1031+
/*
1032+
Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.
1033+
*/
8501034
"redundant-return-value": "Warning",
8511035
/*
8521036
Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned.
8531037
*/
8541038
"redundant-value": "Warning",
1039+
/*
1040+
Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.
1041+
*/
8551042
"return-type-mismatch": "Warning",
1043+
/*
1044+
Enable diagnostics for typos in strings.
1045+
*/
8561046
"spell-check": "Information",
8571047
/*
8581048
Enable trailing space diagnostics.
8591049
*/
8601050
"trailing-space": "Hint",
1051+
/*
1052+
Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).
1053+
*/
8611054
"unbalanced-assignments": "Warning",
1055+
/*
1056+
Enable diagnostics for class annotations in which an undefined class is referenced.
1057+
*/
8621058
"undefined-doc-class": "Warning",
1059+
/*
1060+
Enable diagnostics for type annotations referencing an undefined type or alias.
1061+
*/
8631062
"undefined-doc-name": "Warning",
1063+
/*
1064+
Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.
1065+
*/
8641066
"undefined-doc-param": "Warning",
8651067
/*
8661068
Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment.
8671069
*/
8681070
"undefined-env-child": "Information",
1071+
/*
1072+
Enable diagnostics for cases in which an undefined field of a variable is read.
1073+
*/
8691074
"undefined-field": "Warning",
8701075
/*
8711076
Enable undefined global variable diagnostics.
8721077
*/
8731078
"undefined-global": "Warning",
1079+
/*
1080+
Enable diagnostics for casts of undefined variables.
1081+
*/
8741082
"unknown-cast-variable": "Warning",
1083+
/*
1084+
Enable diagnostics in cases in which an unknown diagnostics code is entered.
1085+
*/
8751086
"unknown-diag-code": "Warning",
1087+
/*
1088+
Enable diagnostics for unknown operators.
1089+
*/
8761090
"unknown-operator": "Warning",
1091+
/*
1092+
Enable diagnostics for unreachable code.
1093+
*/
8771094
"unreachable-code": "Hint",
8781095
/*
8791096
Enable unused function diagnostics.

doc/pt-br/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Array<string>
190190

191191
* ``"action-after-return"``
192192
* ``"ambiguity-1"``
193+
* ``"ambiguous-syntax"``
193194
* ``"args-after-dots"``
194195
* ``"assign-type-mismatch"``
195196
* ``"await-in-sync"``

0 commit comments

Comments
 (0)