digitalmars.D.learn - How to warn of unused imports?
- cy (5/5) Feb 08 2016 When I factor out code from my modules, it really, really often
- Daniel Kozak via Digitalmars-d-learn (4/9) Feb 08 2016 I dont think there is a way right now. But in a future dscanner.
- Basile B. (10/20) Feb 08 2016 I don't think that Dscanner will be able to do this soon. Its
- Adam D. Ruppe (3/5) Feb 08 2016 Remove one, recompile. If it passes, leave it. If not, undo and
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/9) Feb 08 2016 Similarly, I comment out all; then uncomment one by one according to
When I factor out code from my modules, it really, really often leaves import statements that just sit there doing nothing, making it look like my program is more complex than it is. How do I get warned for leaving those, and a list of which ones I can safely remove?
Feb 08 2016
V Mon, 08 Feb 2016 08:25:09 +0000 cy via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> napsáno:When I factor out code from my modules, it really, really often leaves import statements that just sit there doing nothing, making it look like my program is more complex than it is. How do I get warned for leaving those, and a list of which ones I can safely remove?I dont think there is a way right now. But in a future dscanner. https://github.com/Hackerpilot/Dscanner/issues/134
Feb 08 2016
On Monday, 8 February 2016 at 08:50:17 UTC, Daniel Kozak wrote:V Mon, 08 Feb 2016 08:25:09 +0000 cy via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> napsáno:I don't think that Dscanner will be able to do this soon. Its scope is limited to a single module, it's not like DCD, which works with the imports and which is able to look-up elsewhere. For example you'll see this if you try to make an analyzer that produces warnings for signed & unsigned comparison. It impossible without a bit of semantic (ref: https://github.com/Hackerpilot/Dscanner/issues/204). Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning.When I factor out code from my modules, it really, really often leaves import statements that just sit there doing nothing, making it look like my program is more complex than it is. How do I get warned for leaving those, and a list of which ones I can safely remove?I dont think there is a way right now. But in a future dscanner. https://github.com/Hackerpilot/Dscanner/issues/134
Feb 08 2016
On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote:Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning.It definitely does sound like a decent enhancement request. I didn't know it wasn't implemented yet, but it should be pretty straightforward, since within DMD you can access the AST. Alternatively, implementing DIP50 might let you do it outside the compiler. http://wiki.dlang.org/DIP50
Feb 08 2016
On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote:On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote:DIP50 is a "golem" It looks usefull, and it will help in many cases...but after a while it'll become a problem.Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning.It definitely does sound like a decent enhancement request. I didn't know it wasn't implemented yet, but it should be pretty straightforward, since within DMD you can access the AST. Alternatively, implementing DIP50 might let you do it outside the compiler. http://wiki.dlang.org/DIP50
Feb 09 2016
On Tuesday, 9 February 2016 at 15:21:59 UTC, Basile B. wrote:On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote:If you don't understand what's a "golem": AlquiaDa was the golem of the CIA (in the 80's while russians were fighting in Afgnan). Useful until a certain point. Useful until a certain point...On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote:DIP50 is a "golem" It looks usefull, and it will help in many cases...but after a while it'll become a problem.Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning.It definitely does sound like a decent enhancement request. I didn't know it wasn't implemented yet, but it should be pretty straightforward, since within DMD you can access the AST. Alternatively, implementing DIP50 might let you do it outside the compiler. http://wiki.dlang.org/DIP50
Feb 09 2016
On Tuesday, 9 February 2016 at 17:54:30 UTC, Basile B. wrote:On Tuesday, 9 February 2016 at 15:21:59 UTC, Basile B. wrote:It's time for me to leave...once again alcool drives me crazy... Latest weeks I've been ofensive against two guys: kinsley and lopatim...it's time for me to leave. https://www.youtube.com/watch?v=6ixdPnLFVIo seeya.On Monday, 8 February 2016 at 20:48:29 UTC, cy wrote:If you don't understand what's a "golem": AlquiaDa was the golem of the CIA (in the 80's while russians were fighting in Afgnan). Useful until a certain point. Useful until a certain point...On Monday, 8 February 2016 at 18:57:52 UTC, Basile B. wrote:DIP50 is a "golem" It looks usefull, and it will help in many cases...but after a while it'll become a problem.Otherwise, it sounds like a decent enhancement request for DMD. I know other compilers who do this warning.It definitely does sound like a decent enhancement request. I didn't know it wasn't implemented yet, but it should be pretty straightforward, since within DMD you can access the AST. Alternatively, implementing DIP50 might let you do it outside the compiler. http://wiki.dlang.org/DIP50
Feb 09 2016
On Monday, 8 February 2016 at 08:25:09 UTC, cy wrote:How do I get warned for leaving those, and a list of which ones I can safely remove?Remove one, recompile. If it passes, leave it. If not, undo and move on to the next one.
Feb 08 2016
On 02/08/2016 06:35 AM, Adam D. Ruppe wrote:On Monday, 8 February 2016 at 08:25:09 UTC, cy wrote:Similarly, I comment out all; then uncomment one by one according to compilation errors. AliHow do I get warned for leaving those, and a list of which ones I can safely remove?Remove one, recompile. If it passes, leave it. If not, undo and move on to the next one.
Feb 08 2016