Low hanging fruits

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Low hanging fruits

Post by PrzemoF »

I'm going to post here things that probably should be changed in the source code, but I might not be able to do it on my own soon. It also may be a hint for a new developer what he/she might do ;)

1. Replace hard coded workbech icons with image files.
A "template" commit: https://github.com/FreeCAD/FreeCAD_sf_m ... 2a8fc91b57

Files that need to be looked at:
src/Mod/ReverseEngineering/InitGui.py /
src/Mod/Draft/InitGui.py /
src/Mod/TemplatePyMod/InitGui.py /
src/Mod/JtReader/InitGui.py /
src/Mod/Complete/InitGui.py /
src/Mod/Points/InitGui.py /
src/Mod/PartDesign/InitGui.py /
src/Mod/Arch/InitGui.py /
src/Mod/Test/InitGui.py /
src/Mod/Mesh/InitGui.py /
src/Mod/Cam/InitGui.py /
src/Mod/Part/InitGui.py /
src/Mod/OpenSCAD/InitGui.py /
src/Mod/Import/InitGui.py /
src/Mod/MeshPart/InitGui.py /
src/Mod/Assembly/InitGui.py /
src/Mod/Image/InitGui.py /
src/Mod/Sketcher/InitGui.py /
src/Mod/Spreadsheet/InitGui.py /
src/Mod/Robot/InitGui.py /
src/Mod/Web/InitGui.py /
src/Mod/Start/InitGui.py /
src/Mod/Drawing/InitGui.py /
src/Mod/Raytracing/InitGui.py

2. Removing imported but unused python modules. flake8 shows a few of them ( 442 to be precise), but there might be some false-positives, so it needs to be done carefully. The full list: http://www.pasteall.org/57800 generated with:

Code: Select all

fedora-lan:/home/przemo/fedora/FreeCAD/freecad
$ find . -name "*.py" | xargs -I {} flake8 --select=F401 {}[code]
[/code]

3.Cleaning blank lines with white characters (1379 of them). Generated with:

Code: Select all

fedora-lan:/home/przemo/fedora/FreeCAD/freecad
$ find . -name "*.py" | xargs -I {} flake8 --select=W293 
Some simple sed could fix it quickly, but a review would be required to make sure it's safe (some multi line comments?)

4. Cleaning assigned but never used local variables. Full list: http://www.pasteall.org/57801 generated with:

Code: Select all

fedora-lan:/home/przemo/fedora/FreeCAD/freecad
$ find . -name "*.py" | xargs -I {} flake8 --select=F841
More to come....
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Low hanging fruits

Post by ian.rees »

Consider removing stuff that's already #ifdef'd out from old changes. For example, investigate whether NO_USE_QT_MDI_AREA is ever intended to be changed, and remove irrelevant code if not. -Ian-
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Low hanging fruits

Post by PrzemoF »

Not an easy one: provide an option to override built-in icons with something from user config directory.

Edit: http://freecadweb.org/tracker/view.php?id=2053
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Low hanging fruits

Post by yorik »

Very good ideas!
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Low hanging fruits

Post by drei »

Would it be reasonable to make week long feature freeze to fix the issues that have been reported up until now?
Adding more features would just end up adding more stuff to format or edit later on.
Need help? Feel free to ask, but please read the guidelines first
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Low hanging fruits

Post by yorik »

IMHO these are not bugfixes, but improvements... Not sure they needed to be backported to 0.15
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Low hanging fruits

Post by shoogen »

drei wrote:Would it be reasonable to make week long feature freeze to fix the issues that have been reported up until now?
No, it wouldn't.
You can establish quality standards for new contributions. Those would be checked before integrating a pull request.
But a feature freeze is only usefull to prepare releases. If you want to propose a change in the code, you can create a pull request, just like anybody else. If merge conflicts arise other people might help you to resolve it.
But the issues reported so far implement features or refactor some code. Those are improvements, they don't fix real bugs.
So I see no point in hindering others to contribute new features.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Low hanging fruits

Post by ian.rees »

I think the first step is to decide whether formatting, etc. is something that we want to pursue.

No feature freeze is required either way - we just start making sure that any committed code meets the agreed on (good luck! :) ) guidelines, and go cleanup existing code in the meantime. -Ian-

Edit: Holy synchronised posts, batman!
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: Low hanging fruits

Post by frabice »

For my first contribution, I think I will do the first point of the first post. I was thinking of taking the icons from the wiki to replace the hard coded icons. How does that sound?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Low hanging fruits

Post by PrzemoF »

frabice wrote:For my first contribution, I think I will do the first point of the first post. I was thinking of taking the icons from the wiki to replace the hard coded icons. How does that sound?
Sounds good, but I wouldn't wait for an official "go ahead". Make the changes, split them nicely one commit per wb, so if something is wrong it will be easy to catch and submit them.

I'm not a core developer, so don't treat my post as an official opinion from the project.
Post Reply