mirror of
https://github.com/jongracecox/anybadge.git
synced 2026-01-04 19:32:11 +01:00
Added reStructuredText syntax check to setup.py and updated README.
This commit is contained in:
36
README.md
36
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` | 
|
||||
| `anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green` | 
|
||||
| `anybadge --value=65 --file=coverage.svg coverage` | 
|
||||
| `anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red` | 
|
||||
| `anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00` | 
|
||||
#### Pylint using template
|
||||
```
|
||||
anybadge --value=2.22 --file=pylint.svg pylint
|
||||
```
|
||||

|
||||
|
||||
#### Pylint using arguments
|
||||
```
|
||||
anybadge -l pylint -v 2.22 -f pylint.svg 2=red 4=orange 8=yellow 10=green
|
||||
```
|
||||

|
||||
|
||||
#### Coverage using template
|
||||
```
|
||||
anybadge --value=65 --file=coverage.svg coverage
|
||||
```
|
||||

|
||||
|
||||
#### Pipeline, using labeled colors
|
||||
```
|
||||
anybadge --label=pipeline --value=passing --file=pipeline.svg passing=green failing=red
|
||||
```
|
||||

|
||||
|
||||
#### Badge with fixed color
|
||||
```
|
||||
anybadge --label=awesomeness --value="110%" --file=awesomeness.svg --color=#97CA00
|
||||
```
|
||||

|
||||
|
||||
### Options
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
mister-bump>=1.0.0
|
||||
m2r
|
||||
m2r
|
||||
restructuredtext_lint
|
||||
16
setup.py
16
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'],
|
||||
|
||||
Reference in New Issue
Block a user