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

feat: validate imports #1838

Merged
merged 2 commits into from
Nov 29, 2023
Merged

feat: validate imports #1838

merged 2 commits into from
Nov 29, 2023

Conversation

SKairinos
Copy link
Contributor

@SKairinos SKairinos commented Nov 24, 2023

This change is Reviewable

Copy link
Member

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @SKairinos)


game_frontend/src/pyodide/syntax.ts line 93 at r1 (raw file):

  const fromImports: Record<string, Set<string>> = {};
  for (const match of code.matchAll(pattern)) {

Do you need this for loop? Could we do something like this? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll

Copy link
Member

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SKairinos)


game_frontend/src/pyodide/syntax.ts line 11 at r1 (raw file):

  lineStart: boolean
  captureName: boolean
  captureArgs: boolean

Are these ever true at any point? If not, do we need them as args?

Code quote:

  lineStart: boolean
  captureName: boolean
  captureArgs: boolean

Copy link
Contributor Author

@SKairinos SKairinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97)


game_frontend/src/pyodide/syntax.ts line 11 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Are these ever true at any point? If not, do we need them as args?

not currently. I made them as args in a callable because if in the future we ever need to match a function signature, I would like us to reuse this rather than repeating pattern with slick tweaks each time.


game_frontend/src/pyodide/syntax.ts line 93 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Do you need this for loop? Could we do something like this? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll

yes, it's needed because we process each match differently depending on the type of match. see the further processing inside the enclosed if/else statements

Copy link
Member

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SKairinos)

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Merging #1838 (c5b95a5) into master (e09cf2d) will increase coverage by 0.07%.
The diff coverage is 77.08%.

❗ Current head c5b95a5 differs from pull request most recent head a20eca1. Consider uploading reports for the commit a20eca1 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1838      +/-   ##
==========================================
+ Coverage   70.85%   70.93%   +0.07%     
==========================================
  Files         192      193       +1     
  Lines        3991     4039      +48     
  Branches      272      283      +11     
==========================================
+ Hits         2828     2865      +37     
- Misses       1134     1145      +11     
  Partials       29       29              
Files Coverage Δ
game_frontend/src/pyodide/syntax.ts 100.00% <100.00%> (ø)
game_frontend/src/pyodide/webWorker.ts 30.00% <8.33%> (-6.85%) ⬇️

Copy link
Member

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SKairinos)

@SKairinos SKairinos merged commit 0c07148 into master Nov 29, 2023
7 of 8 checks passed
@SKairinos SKairinos deleted the validate_imports branch November 29, 2023 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants