Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactoring #47

Open
Mte90 opened this issue Mar 11, 2022 · 3 comments
Open

Code refactoring #47

Mte90 opened this issue Mar 11, 2022 · 3 comments
Assignees

Comments

@Mte90
Copy link
Owner

Mte90 commented Mar 11, 2022

The code on https://github.com/Mte90/GH-License/blob/master/ghlicense/cmd.py is too long and probably is better to split in various files.

@Dynnammo Dynnammo self-assigned this Oct 3, 2022
@Dynnammo
Copy link
Contributor

Dynnammo commented Oct 3, 2022

I'll gladly do many changes, with among them (order not important)

  • Refactor all strings concatenation to f-strings : not very useful, but quick win for motivation
  • Flake8 and some linting
  • Revamp report creation : instead of creating a file throughout the script, make a main dictionnary that stores information then use a separate function to deal with report file creation
  • Separate the 3 main branch of the command line in 3 different files to differ them
  • Use progressbar library to replace current workaround : https://github.com/WoLpH/python-progressbar
  • Minimal testing cover : don't know how to proceed yet, since it needs dummies GitHub or BitBucket users/organizations to test all possible cases

Thoughts @Mte90 ?

@Mte90
Copy link
Owner Author

Mte90 commented Oct 4, 2022

I agree with everything, just about tests we have the ticket #34

If we can simplify and organize it better it will be simpler to add new things and supports for other services.

@Mte90
Copy link
Owner Author

Mte90 commented Oct 10, 2022

Reading the code I think that https://github.com/Mte90/GH-License/blob/master/ghlicense/cmd.py#L348

This section will be better if we switch to a switch case or to an array

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

No branches or pull requests

2 participants