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 lint warnings/no-warning-comments #1010

Merged

Conversation

njmulsqb
Copy link
Contributor

@njmulsqb njmulsqb commented Sep 22, 2021

Fixed couple of warnings.

Fixes partially #608

@njmulsqb njmulsqb force-pushed the fix-lint-warnings/no-warning-comments branch 3 times, most recently from b2bd1f9 to 91fe5c6 Compare September 22, 2021 15:34
@psiinon
Copy link
Member

psiinon commented Sep 22, 2021

In general we shouldnt just delete TODOs without actually adressing the things they were about .. but in this case I think its reasonable :)

@thc202
Copy link
Member

thc202 commented Sep 22, 2021

From which linter is that?

@njmulsqb
Copy link
Contributor Author

In general we shouldnt just delete TODOs without actually adressing the things they were about .. but in this case I think its reasonable :)

Actually the linter says that such comments should not exist in a production software, what should I do with rest of the todo comments that are causing warnings?

@njmulsqb
Copy link
Contributor Author

From which linter is that?

Default linter of hud, I guess eslint. Got the warnings by ./gradlew npmLintAllHud

@thc202 thc202 changed the title Fix lint warnings/no warning comments Fix lint warnings/no-warning-comments Sep 22, 2021
@thc202
Copy link
Member

thc202 commented Sep 22, 2021

Thank you. Yes, ideally we should fix them all, either address the todo or remove if no longer relevant.

@njmulsqb
Copy link
Contributor Author

Thank you. Yes, ideally we should fix them all, either address the todo or remove if no longer relevant.

How can I be sure that a particular todo is no longer relevant?

@thc202
Copy link
Member

thc202 commented Sep 22, 2021

Though question, it really depends of what the todo is about :) If not sure just ask.

@njmulsqb
Copy link
Contributor Author

Working to remove // Todo: change this to a util function that reads in a config file (json/xml) now from code

@njmulsqb
Copy link
Contributor Author

I have one question @thc202,
I have removed all the // Todo: change this to a util function that reads in a config file (json/xml) from code but when I try ./gradlew build or ./gradlew npmLintAllHud the build fails, I dont know why removing some comments is failing it.
If I run ./gradlew run it runs successfully.

What could be the reason of this behavior?

@thc202
Copy link
Member

thc202 commented Oct 25, 2021

What is the error? Might be some formatting check.

@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 6, 2022

Working to remove // Todo: change this to a util function that reads in a config file (json/xml) now from code

Removed all of its occurrences

@thc202
Copy link
Member

thc202 commented May 6, 2022

Thank you, could you revert the changes done to the lock file and fix up all the commits?

@njmulsqb njmulsqb force-pushed the fix-lint-warnings/no-warning-comments branch from b18bb92 to 93164c8 Compare May 7, 2022 05:58
@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 7, 2022

I have reverted changes in package-lock.json file and fixed up last 2 commits.
Should package-lock.json be added to .gitignore to avoid pushing changes again? Running npm i updates this file

@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 7, 2022

These are the pending no-warning-comments in HUD.

// TODO change to try loading from localstorage (src\main\zapHomeFiles\hud\tools\commonAlerts.js)
// Todo: change this to 'continue' and figure out / fix stopBreaking (src\main\zapHomeFiles\hud\tools\break.js)
// FIXME: remove after #620 (src\main\zapHomeFiles\hud\display.js)
// Todo: is this too hacky? (src\main\zapHomeFiles\hud\target\inject.js)
// TODO showComments section - put this code in a separate file and inject ? (src\main\zapHomeFiles\hud\target\inject.js)
// TODO showEnable section - put this code in a separate file and inject ? (src\main\zapHomeFiles\hud\target\inject.js)

Give me the go-ahead to remove them and then we can merge this PR

@thc202
Copy link
Member

thc202 commented May 7, 2022

Better leave those for now. The commits were not fixed up yet.

@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 7, 2022

Better leave those for now. The commits were not fixed up yet.

I have merged the 2 consequent commits, but the earlier ones are from Oct last year, after which many more commits have been made as visible via git log --oneline how can I merge non-consecutive commits?

@thc202
Copy link
Member

thc202 commented May 7, 2022

The following should do it:

git fetch upstream
git rebase -i upstream/main

Set the last two commits to fixup and done.

@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 7, 2022

git rebase -i upstream/main

I have these commits,

pick 91fe5c6 no-warning-comments resolved
pick 62222b2 Some more warning comments removed
pick 319133f build(deps): bump vue-i18n from 8.26.5 to 8.26.7
pick 90427c5 build(deps-dev): bump eslint-plugin-no-unsanitized from 3.2.0 to 4.0.1
pick c5794ea fix: remove some TODO comments to solve lint warnings

The last two were already fixed up. Are you talking about first two?

@thc202
Copy link
Member

thc202 commented May 7, 2022

Remove the lines containing 319133f and 90427c5 and set 62222b2 and c5794ea to fixup.

@njmulsqb njmulsqb force-pushed the fix-lint-warnings/no-warning-comments branch from 93164c8 to 74c8c68 Compare May 7, 2022 13:50
@njmulsqb
Copy link
Contributor Author

njmulsqb commented May 7, 2022

I think we're done with all the no-warning-comments now except the 6 as mentioned previously.

@thc202 thc202 merged commit 7a8d4e6 into zaproxy:main May 8, 2022
@thc202
Copy link
Member

thc202 commented May 8, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants