[Bug 30926] New: Remove unnecessary use statements
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Bug ID: 30926 Summary: Remove unnecessary use statements Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 17600 We have 'use' statements that are useless. We could remove them. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17600 [Bug 17600] Standardize the EXPORT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135804 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135804&action=edit Bug 30926: [DO NOT PUSH] Yet another script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135805 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135805&action=edit Bug 30926: Remove unnecessary use statements This is the result of: perl remove_unused_import.pl **/*.pl **/*.pm svc/* svc/**/* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135806 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135806&action=edit Bug 30926: Manual fixes Wrong occurrences caught by the script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com, | |tomascohen@gmail.com Status|ASSIGNED |In Discussion --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Very boring job now to confirm the script is not buggy. I don't think I am going to work more on this one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135805|0 |1 is obsolete| | Attachment #135806|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 136250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136250&action=edit Bug 30926: Remove unnecessary use statements This is the result of (using a zsh shell): perl remove_unused_import.pl **/*.pl **/*.pm svc/* svc/**/* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 136251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136251&action=edit Bug 30926: Manual fixes Wrong occurrences caught by the script -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Tomas: Is this something that you would be willing to push quickly? In that case I might have a look soon,, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #7)
Tomas: Is this something that you would be willing to push quickly? In that case I might have a look soon,,
yes... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #8)
(In reply to Marcel de Rooy from comment #7)
Tomas: Is this something that you would be willing to push quickly? In that case I might have a look soon,,
yes...
Tomas never responded -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #9)
(In reply to Jonathan Druart from comment #8)
(In reply to Marcel de Rooy from comment #7)
Tomas: Is this something that you would be willing to push quickly? In that case I might have a look soon,,
yes...
Tomas never responded
There are too many things to look after, all the time. I've been pushing as fast as possible this kind of patch sets. If you are willing to work in this a bit more, I'm all in. Just DM me when ready so I add it to my priorities. Best regards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136250|0 |1 is obsolete| | Attachment #136251|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 138795 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138795&action=edit Bug 30926: Remove unnecessary use statements This is the result of: perl remove_unused_import.pl **/*.pl **/*.pm svc/* svc/**/* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- No test plan, it's expected. If you don't know what to do here, pick another bug ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- The script looks fairly simple and readable.. feels correct. I'm no expert on imports however... The results seem reasonable on all tests I currently performed.. I think this might be a 'push and fix the mess' type bug.. it feels good to go to me, but I wouldn't be at all surprised if there are some random bugs deep in there.. I'm happy to monitor and fix the resulting issues in Jonathans absence once he's out later this month if it helps. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |joonas.kylmala@iki.fi --- Comment #14 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Did some testing, even though this doesn't currently apply on top of master. However seems like the script might be a bit too eager with the removals:
Compilation failed in require at /kohadevbox/koha/Koha/ItemTypes.pm line 23.
I get this among other failures. In ItemTypes.pm C4::Languages is used but this patch removed the use statement. After this patch has been made there has been no changes to ItemTypes.pm so I think it is indeed an issue with the script that generates this patch. Another corner case not handled by the script: C4/SIP/SIPServer.pm: C4::SIP::Trapper import is used by the tie *STDERR, "C4::SIP::Trapper"; statement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30926 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'd love to see this pursued early next cycle.. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org