-
Notifications
You must be signed in to change notification settings - Fork 0
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
Much stronger nondeterminism detection #7
Conversation
…defined values that way)
…n that's passed a WorkflowContext
- Move the rules + the tests into their own directories - Write some tests (will switch the testing framework to jest later)
…a TODO. Change some error messages.
type GlobalTools = {eslintContext: EslintContext, parserServices: ParserServicesWithTypeInformation, typeChecker: TypeChecker}; | ||
let GLOBAL_TOOLS: GlobalTools | undefined = undefined; | ||
|
||
// These included `Transaction` and `TransactionContext` respectively before! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? I think we want to add Transaction and TransactionContext in the following lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - Peter told me we should leave them out; they were there before, but keeping them in resulted in lots of false positives on the dbos-demo-apps
projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we should only check workflows for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's do it in a future PR.
I think your new rule that allows await
on a function with a ctxt
param would already eliminate most of the false positives.
|
||
try { | ||
if (Node.isSourceFile(tsMorphNode)) { | ||
tsMorphNode.getFunctions().forEach(evaluateFunctionForDeterminism); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since functions outside of classes can't have decorators, do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - there might be classes inside of the functions, and the getFunctions
and getClasses
calls only give you the outermost classes and functions, so you have to recur on the functions and classes inside of all the functions and classes respectively
984cded
to
1beea51
Compare
58ce812
to
56ec5ea
Compare
…ounts (this works better for variadic functions, like 'console.log' and 'setTimeout')
ts-morph
from atypescript-eslint
entrypoint