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:
Jon Grace-Cox
2022-08-08 19:02:02 -04:00
committed by GitHub
parent 217555a155
commit f16867114a
52 changed files with 655 additions and 385 deletions

View File

@@ -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} | ![]({url}) |".format(color=color, hex=hex.upper(), url=url))
print(
"| {color} | {hex} | ![]({url}) |".format(
color=color, hex=hex.upper(), url=url
)
)