mirror of
https://github.com/adrienverge/yamllint.git
synced 2024-11-25 17:10:16 -06:00
Distribution: Create script with setup.py
This commit is contained in:
parent
5ed496f471
commit
be998593dd
24
bin/yamllint
24
bin/yamllint
@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright (C) 2016 Adrien Vergé
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from yamllint import cli
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
cli.run(sys.argv[1:])
|
|
2
setup.py
2
setup.py
@ -42,7 +42,7 @@ setup(
|
|||||||
],
|
],
|
||||||
|
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
scripts=['bin/yamllint'],
|
entry_points={'console_scripts': ['yamllint=yamllint.cli:run']},
|
||||||
package_data={'yamllint': ['conf/*.yml']},
|
package_data={'yamllint': ['conf/*.yml']},
|
||||||
install_requires=['pyyaml'],
|
install_requires=['pyyaml'],
|
||||||
tests_require=['nose'],
|
tests_require=['nose'],
|
||||||
|
@ -62,7 +62,7 @@ class Format(object):
|
|||||||
return line
|
return line
|
||||||
|
|
||||||
|
|
||||||
def run(argv):
|
def run(argv=None):
|
||||||
parser = argparse.ArgumentParser(prog=APP_NAME,
|
parser = argparse.ArgumentParser(prog=APP_NAME,
|
||||||
description=APP_DESCRIPTION)
|
description=APP_DESCRIPTION)
|
||||||
parser.add_argument('files', metavar='FILE_OR_DIR', nargs='+',
|
parser.add_argument('files', metavar='FILE_OR_DIR', nargs='+',
|
||||||
|
Loading…
Reference in New Issue
Block a user