Use a passive checker like pyflakes or any other out there and remove the warning like 'imported but unused' or 'is assigned to but never used' From your local LibreOffice directory run 'pyflakes sw' or 'pyflakes sc' or pyflakes uitest...
Great tool for cleaning py files! I gave it a try and found interesting errors like: com/sun/star/wizards/document/OfficeDocument.py:120: undefined name 'IllegalArgumentException' (it seems the one who converted Java file didn't take into account the type of exception). Is it ok to fix them or should we let this for newcomers since it's an easyhack?
This one might explain some bugs: writerfilter/source/ooxml/factoryimpl_ns.py:402: undefined name 'defineNode'
(In reply to Julien Nabet from comment #2) > This one might explain some bugs: > writerfilter/source/ooxml/factoryimpl_ns.py:402: undefined name 'defineNode' what do you mean ?
When considering the method: 398 def charactersActionForValues(nsNode, refNode): 399 ret = [] 400 401 refName = refNode.getAttribute("name") 402 for defineNode in [i for i in getChildrenByName(getChildByName(nsNode, "grammar"), "define") if defineNode.getAttribute("name") == refName]: 403 ret.append(" {") 404 ret.append(" // %s" % defineNode.getAttribute("name")) 405 for dataNode in getChildrenByName(defineNode, "data"): 406 if dataNode.getAttribute("type") == "int": 407 ret.append(" OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(sText));") 408 ret.append(" pValueHandler->setValue(pValue);") 409 ret.append(" }") 410 411 return ret (see https://opengrok.libreoffice.org/xref/core/writerfilter/source/ooxml/factoryimpl_ns.py?r=c4fa6efa#398) since line 402 is wrong, it's quite possible we never enter the loop so the expected code to generate may never be generated. It might be a source of bugs. I insist to tell "it might" since I must recognize I don't really know if it's the case or not. Remark: I'm not sure too that generating C++ code from Python, Perl whatever is a good thing since it's less easy to debug/maintain. IMHO, this part should be converted in C++ but that's another story. I mean I think we shouldn't wait beginners to fix this type of Pyflakes report since it's not just cleaning a double import or removing an unreferenced variable (note that this one can also hide a real bug too). Don't misunderstand me, I understand the goal of Easyhack, to bring newcomers to gain confidence when hacking LO but I think that we shouldn't wait them for some situations.
Xisco: any updates here?
Let's make it clearer: This easyhacks focuses only on unused python imports
Thank you for your feedback Xisco, so for the other issues than "Unused imports", indicated by PyFlakes, it can be dealt by anyone.
I am beginning to work on this bug as a training
Ilkyu Ju committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/13e0c7258b28c4c4c4453e38f04d975c01a0f07e tdf#132293 remove unused imports from .py files under sc/qa/uitest/autofilter It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I have started to work on this
Victor Kukshiev committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1a0af07a556e53dd156d933a8fb82bd13b5e84b1 tdf#132293 remove unused imports from uitest It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vatsal32 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a804a0a548dc976a1e9063ad2c34b6ce7542542e tdf#132293 removed all the unused imports from the folder sw It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
4k5h1t committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e01854cd8f0c20c57d7e78103834bd806ead3cd9 tdf#132293 removed some unused imports from uitest It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Resetting assignee
tagezi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/30a048cb895a3dcdd6048f3c525edd95a1371b91 tdf#132293: Removing unused imports from uitests files. It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
tagezi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/69a103b57a39798473ebc48fdad0f696cbd606a6 tdf#132293: Removing unused imports from uitests files. It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
tagezi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bd6cb0d8219b117b1a72774c26d54774c72602da tdf#132293: Removing unused imports from uitests files. It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I have started to work on this.
m.hashemian committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3258bfd178749fd3deb06d852389554c69299c1e tdf#132293 remove unused imports and unused variables in sw It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Re-evaluating the EasyHack in 2022 This issue is still relevant. Running pyflakes over core shows ~1500 lines of output, in which many of them are relevant: $ pyflakes . 2>&1 |grep "imported but unused"|wc 351 Se
Setting the status back to NEW.
Rakielle committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/09ba0057e3d7f8c9d1166269b232a8b2692fa506 tdf#132293 remove unused imports and variables It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eedb077f8860e02838b37d75c230e51cd290a283 tdf#132293 remove unused imports from uitest It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0c2d485edece9078629842a0e1202bfb75f6d0d6 tdf#132293 remove unused imports from uitest It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Bogdan B committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/15e94efb87118b0ceb4aa926181a8906259f369b tdf#132293 remove unused imports from uitest It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Uday Sharma committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f18b76cad2e27fe5167cd683916d592088c5bf99 tdf#132293 remove some unused imports from uitests It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
hello is still work here??
Ankit_Jaipuriar committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1f9cd62b67d679da078c50b4b48295918657a70a tdf#132293 remove unused imports from uitest It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Taking on my first assignment. Found this in pyflakes: ``` sw\qa\python\check_xnamedgraph.py:78:5: redefinition of unused 'test_Statements_RemoveByObject' from line 61 ``` Plan is to remove the redundant function and push changes through Cygwin. On a side note, Windows Defender encountered this problem while running pyflakes: ``` Exploit:O97M/CVE-2010-3333.PA ~/lode/dev/core/sw/qa/extras/rtfimport/data/fdo49893-3.rtf ```
Multi-hack, so this is not assigned. (In reply to jfeal from comment #29) > Taking on my first assignment. > > Found this in pyflakes: > ``` > sw\qa\python\check_xnamedgraph.py:78:5: redefinition of unused > 'test_Statements_RemoveByObject' from line 61 > ``` > > Plan is to remove the redundant function and push changes through Cygwin. > > On a side note, Windows Defender encountered this problem while running > pyflakes: > ``` > Exploit:O97M/CVE-2010-3333.PA > ~/lode/dev/core/sw/qa/extras/rtfimport/data/fdo49893-3.rtf > ``` You need to whitelist the lode directory in Windows Defender.
Ashok committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ef36357ee9420956021560b5165708de19a62dc3 tdf#132293 Remove unused import from uitest It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.