Skip to content

Refactor to improve readability and reduce code duplication #19

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

Merged
merged 4 commits into from
Feb 14, 2020

Conversation

nnja
Copy link
Contributor

@nnja nnja commented Feb 13, 2020

I'm not sure if these types of contributions are welcome, but I introduced a new _create_label_group method to the PyBadger class to help improve code readability and reduce code duplication.

Tested on a PyBadge LC.

nnja added 4 commits February 13, 2020 15:13
This method can be used to reduce code duplication in several areas
of the library, and introduces common shared defaults such as black
for the font color.
@nnja nnja force-pushed the refactor_to_reduce_code_dupe branch from 4941869 to de254d0 Compare February 14, 2020 02:07
@makermelissa makermelissa requested a review from a team February 14, 2020 03:18
@ladyada
Copy link
Member

ladyada commented Feb 14, 2020

@makermelissa please review :)

@FoamyGuy
Copy link
Contributor

Tested on EdgeBadge, working well. Looks good to me.

@makermelissa makermelissa self-requested a review February 14, 2020 03:56
Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Code looks great! Thanks for doing this. Tested on PyGamer, so now it's tested on everything.

@makermelissa makermelissa merged commit 9789a71 into adafruit:master Feb 14, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 15, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3MDL to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3MDL#5 from FoamyGuy/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 5.1.1 from 5.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#68 from tannewt/adafruit_ble_package
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#67 from tannewt/service_data
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#66 from tannewt/multivalue_mfg

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.3.2 from 2.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#34 from dherrada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.0.0 from 2.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#37 from geekguy-wy/removing_deinits

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 1.1.0 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#19 from nnja/refactor_to_reduce_code_dupe
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#18 from nnja/add_blinka_bmp
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.

4 participants