Skip to content

Commit

Permalink
Merge pull request #241 from Code-Inspect/238-do-not-allow-todos-in-c…
Browse files Browse the repository at this point in the history
…ode-use-issues

Do not allow todos in code
  • Loading branch information
EagleoutIce authored Aug 23, 2023
2 parents f79546d + 889be7d commit 2495c56
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
}
],
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
// refer to https://github.com/Code-Inspect/flowr/issues/238 for more information: use issues!
"no-warning-comments": ["error", {
"terms": ["todo", "fixme", "xxx"],
"location": "anywhere"
}],
"@typescript-eslint/non-nullable-type-assertion-style": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/key-spacing": [
Expand Down
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ represents the addition of a new feature and the fix of a corresponding test.

To skip the `ci`, you can prefix the commit message with `[skip ci]`.


## ToDo Comments

As indicated by [#238](https://github.com/Code-Inspect/flowr/issues/238) I decided to forbid `TODO`, `FIXME`, and `XXX` comments in code in favor of explicit *issues* directly on GitHub. Please do not try to get around that rule.
2 changes: 1 addition & 1 deletion src/r-bridge/lang-4.x/ast/model/nodes/RFunctionCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface RUnnamedFunctionCall<Info = NoInfo> extends Base<Info>, Locatio
readonly type: Type.FunctionCall;
readonly flavor: 'unnamed';
calledFunction: RNode<Info>; /* can be either a function definition or another call that returns a function etc. */
/** marks function calls like `3 %xxx% 4` which have been written in special infix notation */
/** marks function calls like `3 %xx% 4` which have been written in special infix notation */
infixSpecial?: boolean;
/** arguments can be undefined, for example when calling as `a(1, ,3)` */
arguments: (RArgument<Info> | undefined)[];
Expand Down
18 changes: 9 additions & 9 deletions test/r-bridge/lang/ast/parse-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,25 @@ describe("Parse simple operations",
})
describe('Using unknown special infix operator', () => {
assertAst(
'1 %xxx% 2',
'1 %xx% 2',
shell,
'1 %xxx% 2',
'1 %xx% 2',
exprList(
{
type: Type.FunctionCall,
flavor: 'named',
infixSpecial: true,
info: {},
lexeme: '1 %xxx% 2',
lexeme: '1 %xx% 2',
functionName: {
type: Type.Symbol,
lexeme: '%xxx%',
content: '%xxx%',
lexeme: '%xx%',
content: '%xx%',
namespace: undefined,
location: rangeFrom(1, 3, 1, 7),
location: rangeFrom(1, 3, 1, 6),
info: {}
},
location: rangeFrom(1, 3, 1, 7),
location: rangeFrom(1, 3, 1, 6),
arguments: [
{
type: Type.Argument,
Expand All @@ -198,13 +198,13 @@ describe("Parse simple operations",
info: {},
lexeme: '2',
name: undefined,
location: rangeFrom(1, 9, 1, 9),
location: rangeFrom(1, 8, 1, 8),
value: {
type: Type.Number,
content: numVal(2),
info: {},
lexeme: "2",
location: rangeFrom(1, 9, 1, 9)
location: rangeFrom(1, 8, 1, 8)
}
}
]
Expand Down

0 comments on commit 2495c56

Please sign in to comment.