| 1 | Please look at theses error messages, find duplicates, find a english readable enumeration member name and put it in the enum at the bottom of the code. |
| 2 | |
| 3 | If few of you do this, there will be the base for cobra warning refactoring, thanks. |
| 4 | |
| 5 | {{{ |
| 6 | """ purpose: refactor this ("grep -rn .warning( *.cobra " from r1903): |
| 7 | BinaryOpExpr.cobra:277: .compiler.warning(this, 'Setting a parameter ("[leftName]") to a class variable ("[rightName]") is often a mistake. You may want to reverse the assignment.') |
| 8 | """ |
| 9 | #BinaryOpExpr.cobra:534: .compiler.warning(this, 'Both the left and right sides of "[opName]" are value types ("[leftType.name]" and "[rightType.name]"), but "[opName]" applies to reference types. Use "[altName]" instead.') |
| 10 | """ |
| 11 | BinaryOpExpr.cobra:537: .compiler.warning(this, 'The left side of "[opName]" is a value type ("[leftType.name]") while the right side is an incompatible reference type ("[rightType.name]").') |
| 12 | BinaryOpExpr.cobra:539: .compiler.warning(this, 'The right side of "[opName]" is a value type ("[rightType.name]") while the left side is an incompatible reference type ("[leftType.name]").') |
| 13 | BinaryOpExpr.cobra:614: .compiler.warning(this, 'An explicit "this" literal is unnecessary for accessing members of the current object. You can remove "this".') |
| 14 | BinaryOpExpr.cobra:616: .compiler.warning(this, 'An explicit dot (".") is unnecessary for accessing underscored members of the current object. You can remove ".".') |
| 15 | BinaryOpExpr.cobra:673: .compiler.warning(this, 'The result of "[member.name]" should be used in an expression such as assignment or passing arguments (as indicated by its MustUseResult attribute).') |
| 16 | BinaryOpExpr.cobra:744: .compiler.warning(this, 'The expression is always of type "[.right.toCobraSource]".') |
| 17 | BinaryOpExpr.cobra:753: .compiler.warning(this, 'The expression will always be of type "[.right.toCobraSource]" when not nil. You can just check for not nil by removing "inherits [.right.toCobraSource]".') |
| 18 | BinaryOpExpr.cobra:761: .compiler.warning(this, 'The expression is always of type "[.right.toCobraSource]".') |
| 19 | BinaryOpExpr.cobra:765: .compiler.warning(this, 'The expression (of type "[leftType.name]") is never of type "[.right.toCobraSource]".') |
| 20 | BinaryOpExpr.cobra:772: .compiler.warning(this, 'The expression (of type "[leftType.name]") is never of type "[.right.toCobraSource]".') |
| 21 | BinaryOpExpr.cobra:834: .compiler.warning(this, 'The given expression is already a "[_rightTypeExpr.toCobraSource]", but nilable. You can just use "to !".') |
| 22 | BinaryOpExpr.cobra:837: .compiler.warning(this, 'The given expression is already a "[_left.type.name]", but not nilable. You can just use "to ?".') |
| 23 | BinaryOpExpr.cobra:839: .compiler.warning(this, 'The given expression is already a "[_rightTypeExpr.toCobraSource]" so the typecast is redundant. You can remove it.') |
| 24 | Boxes.cobra:1092: .compiler.warning(this, 'When attributes are declared, they should be suffixed with "Attribute".') |
| 25 | CobraParser.cobra:37: def warning(we as CobraWarning) |
| 26 | """ |
| 27 | #CobraParser.cobra:197: _warning('File is empty.') |
| 28 | #CobraParser.cobra:199: _warning('File is completely blank.') |
| 29 | #CobraParser.cobra:450: _warning('Colons are not used to start indented blocks. You can remove the colon.') |
| 30 | #CobraParser.cobra:488: _warning('Colons are not used to start indented blocks. You can remove the colon.') |
| 31 | """ |
| 32 | CobraParser.cobra:592: _warning(msg) |
| 33 | CobraParser.cobra:793: _warning(.last, '"fake" has been deprecated. Use "extern" instead.') # deprecated on 2008-10-03 |
| 34 | CobraParser.cobra:1214: _warning('Encountered "pass" in a class that already has declared members.') # TODO: change to an error |
| 35 | """ |
| 36 | #CobraParser.cobra:1264: _warning('Colons are not used to start indented blocks. You can remove the colon.') |
| 37 | """ |
| 38 | CobraParser.cobra:1266: _warning('Colons are not required with invariants. You can remove the colon.') |
| 39 | CobraParser.cobra:1315: _warning(opener, 'Unnecessary parentheses. You can remove them.') |
| 40 | CobraParser.cobra:1428: _warning(opener, 'Unnecessary parentheses. You can remove them.') |
| 41 | CobraParser.cobra:1529: _warning(.peek, 'Interface `test` sections are parsed, but ignored. In the future, classes will acquire the tests of the interfaces they implement.') |
| 42 | CobraParser.cobra:1665: _warning(.peek, 'Interface `test` sections are parsed, but ignored. In the future, classes will acquire the tests of the interfaces they implement.') |
| 43 | CobraParser.cobra:1716: _warning('The first parameter is "self" which may be a Python carry-over on your part. Cobra does not require that (and calls it "this" anyway).') |
| 44 | CobraParser.cobra:1859: _warning('More than 100 lines of code ([codePart.statements.count] toplevel statements) in method [fullName].') |
| 45 | CobraParser.cobra:2415: _warning('Colons are not used to put a target statement on the same line. Use a comma (,) instead.') |
| 46 | CobraParser.cobra:2588: _warning(expr.token, 'Unnecessary parentheses around expression. You can remove them.') |
| 47 | CobraParser.cobra:3088: _warning('Assuming empty dictionary, but please use "{:}" for empty dictionary or "{,}" for empty set') |
| 48 | CobraParser.cobra:3490: def _warning(msg as String) |
| 49 | CobraParser.cobra:3491: _warning(.last, msg) |
| 50 | CobraParser.cobra:3493: def _warning(token as IToken, msg as String) |
| 51 | CobraParser.cobra:3494: _warningRecorder.warning(CobraWarning(_fileName, token, msg)) |
| 52 | """ |
| 53 | #Compiler.cobra:1187: .warning(CobraWarning(fileName, nil, 'Cannot write source code corrections due to: [exc.message] ([exc.getType.name]).')) |
| 54 | """ |
| 55 | Compiler.cobra:1348: def warning(node as ISyntaxNode, msg as String) |
| 56 | Compiler.cobra:1350: .warning(CobraWarning(node.token, msg)) |
| 57 | Compiler.cobra:1352: def warning(cw as CobraWarning) |
| 58 | Expr.cobra:552: .compiler.warning(this, 'Unnecessary parentheses. You can remove them.') |
| 59 | Expr.cobra:2034: .compiler.warning(this, 'The value nil will always evaluate to false.') |
| 60 | Expr.cobra:2065: .compiler.warning(_notExpr, 'The expression "[_notExpr.toCobraSource]" (of type "[type.name]") will never evaluate to false because the expression is not nilable. [hint]') |
| 61 | Expr.cobra:2075: .compiler.warning(this, 'The expression "[_expr.toCobraSource]" (of type "[type.name]") will always evaluate to true because it is not nilable. [hint]') |
| 62 | Expr.cobra:2957: .compiler.warning(this, 'The given expression is already nilable so "to ?" is redundant. You can remove it.') # TODO: needs test case |
| 63 | Expr.cobra:2988: .compiler.warning(this, 'The given expression is already non-nilable so "to !" is redundant. You can remove it.') # TODO: needs test case |
| 64 | InstallFromWorkspace.cobra:156: def warning(msg) |
| 65 | """ |
| 66 | #Members.cobra:215: .compiler.warning(this, 'Duplicate modifier "[name]". You can remove it.') |
| 67 | """ |
| 68 | Members.cobra:354: .compiler.warning(this, 'Cannot locate a single invoke method of "[_handlerType.name]".') |
| 69 | Members.cobra:358: .compiler.warning(this, 'Cannot determine parameters of event "[.name]".') |
| 70 | Members.cobra:831: .compiler.warning(local, 'The value of variable "[local.name]" is never used.') |
| 71 | Members.cobra:1080: if .name == '__init__', .compiler.warning(this, 'Initializers are named "init" with no surrounding underscores.') |
| 72 | NameSpace.cobra:192: .compiler.warning(this, 'Namespace names should start with an uppercase letter in order to avoid collisions with other identifiers such as arguments and local variables.') |
| 73 | NameSpace.cobra:210: .compiler.warning(this, 'Multiple namespaces in "[.fullName]" differ only by case: ' + namesMsgPart) |
| 74 | NameSpace.cobra:217: else, .compiler.warning(this, msg) |
| 75 | Node.cobra:1174: def warning(node as ISyntaxNode, msg as String) # TODO: move to IWarningRecorder |
| 76 | Statements.cobra:973: .compiler.warning(this, unThis) |
| 77 | Statements.cobra:977: .compiler.warning(this, unThis) |
| 78 | TypeProxies.cobra:220: # TODO: .compiler.warning(msg) |
| 79 | TypeProxies.cobra:273: # TODO: .compiler.warning(msg) |
| 80 | """ |
| 81 | |
| 82 | enum WarningMessage |
| 83 | FoundDuplicateModifier # 'Duplicate modifier "[name]". You can remove it.' |
| 84 | FoundEmptyFile # 'File is empty.' / 'File is completely blank.' |
| 85 | FoundBeginBlockLineEndedWithColon # 'Colons are not used to start indented blocks. You can remove the colon.' |
| 86 | ExceptionWhileSourceCorrection # 'Cannot write source code corrections due to: [exc.message] ([exc.getType.name]).' |
| 87 | # 'Setting a parameter ("[leftName]") to a class variable ("[rightName]") is often a mistake. You may want to reverse the assignment.' |
| 88 | IncorrectOperatorUseWithValueTypes # 'Both the left and right sides of "[opName]" are value types ("[leftType.name]" and "[rightType.name]"), but "[opName]" applies to reference types. Use "[altName]" instead.' |
| 89 | |
| 90 | }}} |