mirror of
https://github.com/jongracecox/anybadge.git
synced 2025-12-16 02:20:06 +01:00
Add pre-commit config and apply changes (#54)
- Add .pre-commit-config.yaml with initial config. - Add python black pre-commit config - Apply pre-commit code changes - Add information to CONTRIBUTING.md - Add pre-commit to build requirements - Run pre-commit during travis CI build - Use a travis build matrix to control when pre-commit runs in the CI process. Use explicit include to only run pre-commit on Python 3.9.
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
import anybadge
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
|
||||
print("""| Color Name | Hex Code | Example |
|
||||
| ---------- | -------- | ------- |""")
|
||||
print(
|
||||
"""| Color Name | Hex Code | Example |
|
||||
| ---------- | -------- | ------- |"""
|
||||
)
|
||||
for color, hex in sorted(anybadge.COLORS.items()):
|
||||
|
||||
file = 'examples/color_' + color + '.svg'
|
||||
file = "examples/color_" + color + ".svg"
|
||||
|
||||
url = 'https://cdn.rawgit.com/jongracecox/anybadge/master/' + file
|
||||
url = "https://cdn.rawgit.com/jongracecox/anybadge/master/" + file
|
||||
|
||||
anybadge.Badge(label='Color', value=color, default_color=color).write_badge(file, overwrite=True)
|
||||
anybadge.Badge(label="Color", value=color, default_color=color).write_badge(
|
||||
file, overwrite=True
|
||||
)
|
||||
|
||||
print("| {color} | {hex} |  |".format(color=color, hex=hex.upper(), url=url))
|
||||
print(
|
||||
"| {color} | {hex} |  |".format(
|
||||
color=color, hex=hex.upper(), url=url
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user