Skip to content

Conversation

@Svieg
Copy link
Collaborator

@Svieg Svieg commented Jun 8, 2016

Made some refactoring changes to fix PEP8, code duplicity and git tree problems.

@obilodeau
Copy link
Contributor

Be careful when refactoring. Refactoring explicitly states that functional changes should not be implemented:

Code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior.

Removing winpcap (which is required for wireshark to work correctly, and installed just fine last time I tried) is not refactoring. Revert that please.

malboxes.py Outdated
command = "New-ItemProperty"
line = "{0} -Path {1} -Name {2} -Value {3} -PropertyType {4}\r\n".format(
command, args.key, args.name, args.value, args.valuetype)
line = "{} -Path {} -Name {} -Value {} -PropertyType {}\r\n".format(command, args.key, args.name, args.value, args.valuetype)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

longer than 80

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm I wonder why I did that. Will fix.

@obilodeau
Copy link
Contributor

I would refrain from doing pure whitelist PEP8 changes except for lines that were above 80 characters. It doesn't help anything regarding lisibility and it makes git blame or git log -p / search stall on these commit when looking back for specific changes.

Otherwise looking good. I'll add Travis-CI to our project and merge.

malboxes.py Outdated
provisioners_list = config["provisioners"][0]["scripts"]
""" If the script is not already in the profile."""
if filename not in provisioners_list:
provisioners_list.append(fiString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has never worked. fiString has no other reference. You are not supposed to remove bugs during refactoring 😆

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 840ea73 which means that merge won't automatically succeed.

@Svieg
Copy link
Collaborator Author

Svieg commented Jun 8, 2016

What PEP8 changes were not necessary in your opinion ? In my opinion, those helped in the readability of the code so we could be on the same level regarding our coding conventions. For Travis-CI, I think it's a a really good idea !

@obilodeau
Copy link
Contributor

-    parser_list = subparsers.add_parser('list', help=
-            "Lists available profiles.")
+    parser_list = subparsers.add_parser('list',
+                                        help="Lists available profiles.")
     parser_list.set_defaults(func=list_profiles)

Only stuff like this. By default vim will do a two-tab approach when breaking long statements. I hate doing the alignment manually like you did when I'm coding because it slows me down. I need to look for a vim config or plugin that does it automatically. Or, if you are open to it, we accept both styles and we don't fix the other style unless we are already doing changes in these lines of code.

Thoughts?

@Svieg
Copy link
Collaborator Author

Svieg commented Jun 10, 2016

That seems to be the most popular solution (a vim plugin that has been forked on GitHub) but it needs a vim package manager to be installed so I will personally do that(works great IMO) but I have no problem to accept both styles and not fixing the other lines of code for style-only modifications.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants