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

fix: show lint when unused variable is present in code #10599

Merged
merged 6 commits into from
Jan 28, 2022

Conversation

ohansFavour
Copy link
Contributor

@ohansFavour ohansFavour commented Jan 24, 2022

Description

This PR introduces warnings in linting. Users get warned when an unused variable is present in the code.

Screenshot 2022-01-27 at 22 03 12

Fixes #10589

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test coverage results πŸ§ͺ

🟒 Total coverage has increased
// Code coverage diff between base branch:release and head branch: fix/show-lint-error-for-unused-variables 
Status File % Stmts % Branch % Funcs % Lines
🟒 total 55.01 (0.01) 36.57 (0.01) 34.93 (0) 55.41 (0.01)
✨ πŸ†• app/client/src/components/editorComponents/CodeEditor/constants.ts 100 100 100 100
🟒 app/client/src/components/editorComponents/CodeEditor/lintHelpers.ts 97.33 (0.23) 77.78 (1.31) 100 (0) 96.67 (0.31)

@vercel
Copy link

vercel bot commented Jan 24, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

πŸ” Inspect: https://vercel.com/get-appsmith/appsmith/GekxhkZNwpmuruGePxVmpqQLgnpD
βœ… Preview: https://appsmith-git-fix-show-lint-error-for-unused-21460a-get-appsmith.vercel.app

@github-actions github-actions bot added the Bug Something isn't working label Jan 24, 2022
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

4 similar comments
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=9ebfe5b

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1740610742.
Workflow: Appsmith External Integration Test Workflow.
Commit: 9ebfe5b.
PR: 10599.

@ohansFavour ohansFavour changed the title fix: show lint when unused variable is present in user code fix: show lint when unused variable is present in code Jan 24, 2022
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1740610742.
Commit: 9ebfe5b.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 3768.48 3039.6 2943.22 3052.38 3075.33 3175.8 10.55 9.44
painting 46.61 44.19 51.9 46.88 21.17 42.15 28.61 25.60
rendering 807.84 513.98 562.37 561.69 613.9 611.96 18.80 16.82
Edit input
scripting 397.58 454.81 395.42 394.18 445.01 417.4 7.16 6.41
painting 21 10.71 24.25 19.59 11.88 17.49 33.79 30.25
rendering 20.18 33.58 15.29 15.45 26.2 22.14 35.19 31.48
Clear input
scripting 971.79 1098.24 1021.36 1079.87 1035.04 1041.26 4.80 4.29
painting 15.5 27.95 9.03 17.47 7.92 15.57 51.57 46.18
rendering 316.67 394.29 327.36 349.48 330.44 343.65 8.93 7.99
Edit input again
scripting 409.07 434.31 392.46 449.08 424.98 421.98 5.21 4.66
painting 9.91 7.47 17.81 8.89 17.34 12.28 39.98 35.75
rendering 23.87 30.86 24.58 40.8 29.17 29.86 22.77 20.36

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=87b5528

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1747650493.
Workflow: Appsmith External Integration Test Workflow.
Commit: 87b5528.
PR: 10599.

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=ba08502

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1747667732.
Workflow: Appsmith External Integration Test Workflow.
Commit: ba08502.
PR: 10599.

Copy link
Contributor

@rishabhrathod01 rishabhrathod01 left a comment

Choose a reason for hiding this comment

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

Looks good.

mentioned nit pick in above comment

@ohansFavour ohansFavour force-pushed the fix/show-lint-error-for-unused-variables branch from ba08502 to c2984e7 Compare January 27, 2022 21:27
@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=c2984e7

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1758567186.
Workflow: Appsmith External Integration Test Workflow.
Commit: c2984e7.
PR: 10599.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1758567186.
Commit: c2984e7.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 2392.59 2242.81 2098.48 2104.66 2198.85 2207.48 5.46 4.88
painting 19.52 31.56 15.25 23.75 38.83 25.78 36.70 32.82
rendering 465.41 316.72 327.12 358.05 334.16 360.29 16.85 15.07
Edit input
scripting 305.79 336.91 309.47 264.43 363.25 315.97 11.71 10.47
painting 6.16 37.75 19.85 30.67 6.98 20.28 69.28 61.98
rendering 14.57 17.2 15.82 12.49 23.61 16.74 25.15 22.52
Clear input
scripting 739.9 758.89 753.82 727.13 772.16 750.38 2.32 2.07
painting 18.39 24.97 6.16 15.21 18.43 16.63 41.19 36.80
rendering 211.76 219.81 209.09 220.94 226.09 217.54 3.21 2.87
Edit input again
scripting 309.77 725.66 290.74 301.62 285.7 382.7 50.16 44.86
painting 8.77 7.01 4.66 6.87 4.45 6.35 28.35 25.35
rendering 32.17 19.85 18.62 19.65 19.89 22.04 25.82 23.09

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=cd2ff23

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1758764000.
Workflow: Appsmith External Integration Test Workflow.
Commit: cd2ff23.
PR: 10599.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1758764000.
Commit: cd2ff23.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 2160.11 2230.23 2232.54 2227.05 2247.36 2219.46 1.54 1.37
painting 37.53 46.87 37.05 29.43 27.24 35.62 21.79 19.48
rendering 707.23 383.81 367.22 385 391.77 447.01 32.61 29.16
Edit input
scripting 370.73 303.11 353.31 333.57 464.47 365.04 16.71 14.95
painting 14.31 6.5 5.64 19.33 13.32 11.82 48.48 43.40
rendering 18.78 21.35 15.16 22 24.04 20.27 16.87 15.10
Clear input
scripting 790.44 762.4 826.39 790.57 979.59 829.88 10.45 9.35
painting 13.67 16.79 26.73 13.46 7 15.53 46.36 41.47
rendering 262.31 260.09 272.09 263.68 246.2 260.87 3.60 3.22
Edit input again
scripting 352.13 345.26 287.87 375.87 324.4 337.11 9.82 8.78
painting 7.03 18.75 4.84 6.6 18.7 11.18 61.99 55.46
rendering 20.99 21.99 17.96 24.07 22.57 21.52 10.59 9.48

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@ohansFavour
Copy link
Contributor Author

/ok-to-test sha=1588ace

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1760248006.
Workflow: Appsmith External Integration Test Workflow.
Commit: 1588ace.
PR: 10599.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1760248006.
Commit: 1588ace.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 3126.54 2560.58 2690.13 2553.23 2445.19 2675.13 9.98 8.92
painting 33.06 50.26 39.67 28.82 21.76 34.71 31.29 27.97
rendering 610.8 381.27 374.88 356.62 337.37 412.19 27.25 24.38
Edit input
scripting 349.7 346.3 394.96 382.6 330.1 360.73 7.49 6.70
painting 6.42 9.91 8.1 17.15 30.83 14.48 69.13 61.88
rendering 14.06 15.32 16.49 22.85 18.42 17.43 19.68 17.61
Clear input
scripting 957.95 912.17 880.48 837.23 901.92 897.95 4.92 4.40
painting 11.62 17 6.9 27.04 21.62 16.84 47.21 42.22
rendering 260.59 262.59 256.73 242.97 243.36 253.25 3.73 3.34
Edit input again
scripting 323.77 479.86 353.85 322.04 338.99 363.7 18.20 16.28
painting 6.47 82.75 13.08 5.97 8.98 23.45 141.88 126.91
rendering 20.93 30.46 33.64 26.21 26.69 27.59 17.36 15.55

@ohansFavour ohansFavour merged commit d5a459b into release Jan 28, 2022
@ohansFavour ohansFavour deleted the fix/show-lint-error-for-unused-variables branch January 28, 2022 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linter doesn't show an error for unused variables
2 participants