diff --git a/README.md b/README.md index 24cb8be..b6ed4c8 100644 --- a/README.md +++ b/README.md @@ -108,13 +108,35 @@ anybadge --value=2.22 --file=pylint.svg pylint ### Examples -| Example | Badge | -| ------- | ----- | -| `anybadge --value=2.22 --file=pylint.svg pylint` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg) -| `anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg) -| `anybadge --value=65 --file=coverage.svg coverage` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/coverage.svg) -| `anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pipeline.svg) -| `anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00` | ![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/awesomeness.svg) +#### Pylint using template +``` +anybadge --value=2.22 --file=pylint.svg pylint +``` +![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg) + +#### Pylint using arguments +``` +anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green +``` +![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pylint.svg) + +#### Coverage using template +``` +anybadge --value=65 --file=coverage.svg coverage +``` +![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/coverage.svg) + +#### Pipeline, using labeled colors +``` +anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red +``` +![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/pipeline.svg) + +#### Badge with fixed color +``` +anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00 +``` +![pylint](https://github.com/jongracecox/anybadge/blob/master/examples/awesomeness.svg) ### Options diff --git a/build-requirements.txt b/build-requirements.txt index 59e8c83..3acea11 100644 --- a/build-requirements.txt +++ b/build-requirements.txt @@ -1,2 +1,3 @@ mister-bump>=1.0.0 -m2r \ No newline at end of file +m2r +restructuredtext_lint \ No newline at end of file diff --git a/setup.py b/setup.py index 528876f..8960128 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,24 @@ from setuptools import setup from mister_bump import bump from m2r import parse_from_file +import restructuredtext_lint + +# Parser README.md into reStructuredText format +rst_readme = parse_from_file('README.md') + +# Validate the README, checking for errors +errors = restructuredtext_lint.lint(rst_readme) + +# Raise an exception for any errors found +if errors: + print(rst_readme) + raise ValueError('README.md contains errors: ', + ', '.join([e.message for e in errors])) setup( name='anybadge', description='Simple, flexible badge generator for project badges.', - long_description=parse_from_file('README.md'), + long_description=rst_readme, version=bump(), author='Jon Grace-Cox', author_email='jongracecox@gmail.com', @@ -18,7 +31,6 @@ setup( options={ 'bdist_wheel': {'universal': True} }, - platform=['any'], url='https://github.com/jongracecox/anybadge', entry_points={ 'console_scripts': ['anybadge=anybadge:main'],