the great rename of bash8 -> bashate

Once upon a time there was an inside joke, now it's even more so,
but at least it doesn't stomp on the namespace of bash.

Change-Id: I57c5d564fc60d93d154e750ba628277c771d2e66
This commit is contained in:
Sean Dague 2014-06-20 15:06:22 -04:00
parent 2dd066e13e
commit a2815dd86f
17 changed files with 59 additions and 58 deletions

View File

@ -1,7 +1,7 @@
[run]
branch = True
source = bash8
omit = bash8/tests/*,bash8/openstack/*
source = bashate
omit = bashate/tests/*,bashate/openstack/*
[report]
ignore-errors = True

View File

@ -1,4 +1,4 @@
bash8 Style Commandments
bashate Style Commandments
===============================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

View File

@ -1,5 +1,5 @@
===============================
bash8
bashate
===============================
A pep8 equivalent for bash scripts
@ -10,7 +10,7 @@ projects. It started from humble beginnings in the DevStack project,
and will continue to evolve over time.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/bash8
- Documentation: http://docs.openstack.org/developer/bashate
- Source: http://git.openstack.org/cgit/openstack-dev/bash8
- Bugs: http://bugs.launchpad.net/bash8

View File

@ -16,4 +16,4 @@ import pbr.version
__version__ = pbr.version.VersionInfo(
'bash8').version_string()
'bashate').version_string()

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
# bash8 - a pep8 equivalent for bash scripts
# bashate - a pep8 equivalent for bash scripts
#
# this program attempts to be an automated style checker for bash scripts
# to fill the same part of code review that pep8 does in most OpenStack
@ -170,7 +170,7 @@ def check_files(files, verbose):
prev_file = fileinput.filename()
if verbose:
print("Running bash8 on %s" % fileinput.filename())
print("Running bashate on %s" % fileinput.filename())
# NOTE(sdague): multiline processing of heredocs is interesting
if not in_multiline:
@ -214,7 +214,7 @@ def main():
check_files(opts.files, opts.verbose)
if ERRORS > 0:
print("%d bash8 error(s) found" % ERRORS)
print("%d bashate error(s) found" % ERRORS)
return 1
else:
return 0

View File

@ -13,55 +13,55 @@
# under the License.
"""
test_bash8
test_bashate
----------------------------------
Tests for `bash8` module.
Tests for `bashate` module.
"""
import mock
from bash8 import bash8
from bashate import bashate
from bash8.tests import base
from bashate.tests import base
class TestBash8(base.TestCase):
class TestBashate(base.TestCase):
def setUp(self):
super(TestBash8, self).setUp()
super(TestBashate, self).setUp()
# cleanup global IGNOREs
def reset_ignores():
bash8.IGNORE = None
bashate.IGNORE = None
self.addCleanup(reset_ignores)
def test_multi_ignore(self):
bash8.register_ignores('E001|E011')
bash8.check_no_trailing_whitespace("if ")
bash8.check_if_then("if ")
self.assertEqual(bash8.ERRORS, 0)
bashate.register_ignores('E001|E011')
bashate.check_no_trailing_whitespace("if ")
bashate.check_if_then("if ")
self.assertEqual(bashate.ERRORS, 0)
def test_ignore(self):
bash8.register_ignores('E001')
bash8.check_no_trailing_whitespace("if ")
self.assertEqual(bash8.ERRORS, 0)
bashate.register_ignores('E001')
bashate.check_no_trailing_whitespace("if ")
self.assertEqual(bashate.ERRORS, 0)
@mock.patch('bash8.bash8.print_error')
@mock.patch('bashate.bashate.print_error')
def test_while_check_for_do(self, m_print_error):
test_line = 'while `do something args`'
bash8.check_for_do(test_line)
bashate.check_for_do(test_line)
m_print_error.assert_called_once_with(
'E010: Do not on same line as while', test_line)
class TestBash8Samples(base.TestCase):
"""End to end regression testing of bash8 against script samples."""
class TestBashateSamples(base.TestCase):
"""End to end regression testing of bashate against script samples."""
def setUp(self):
super(TestBash8Samples, self).setUp()
log_error_patcher = mock.patch('bash8.bash8.log_error')
super(TestBashateSamples, self).setUp()
log_error_patcher = mock.patch('bashate.bashate.log_error')
self.m_log_error = log_error_patcher.start()
self.addCleanup(log_error_patcher.stop)
@ -78,14 +78,14 @@ class TestBash8Samples(base.TestCase):
(error, lineno))
def test_sample_E001(self):
test_file = 'bash8/tests/samples/E001_bad.sh'
bash8.check_files(test_file, False)
test_file = 'bashate/tests/samples/E001_bad.sh'
bashate.check_files(test_file, False)
self.assert_error_found('E001', 4)
def test_sample_E002(self):
test_file = 'bash8/tests/samples/E002_bad.sh'
bash8.check_files(test_file, False)
test_file = 'bashate/tests/samples/E002_bad.sh'
bashate.check_files(test_file, False)
self.assert_error_found('E002', 3)
@ -94,15 +94,15 @@ class TestBash8Samples(base.TestCase):
This is a legacy compatibility check to make sure we still
catch the same errors as we did before the first 0.1.0
release of the bash8 pypi package. There were no tests
release of the bashate pypi package. There were no tests
before this, so it is our baseline regression check.
New checks shouldn't need to be added here, and should
have their own separate unit test and/or sample file checks.
"""
test_file = 'bash8/tests/samples/legacy_sample.sh'
bash8.check_files(test_file, False)
test_file = 'bashate/tests/samples/legacy_sample.sh'
bashate.check_files(test_file, False)
# NOTE(mrodden): E012 actually requires iterating more than one
# file to detect at the moment; this is bug

View File

@ -37,8 +37,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'bash8'
copyright = u'2013, OpenStack Foundation'
project = u'bashate'
copyright = u'2014, Bashate Authors'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@ -68,8 +68,8 @@ latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
u'Bashate Authors', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
#intersphinx_mapping = {'http://docs.python.org/': None}

View File

@ -1,9 +1,9 @@
.. bash8 documentation master file, created by
.. bashate documentation master file, created by
sphinx-quickstart on Tue Jul 9 22:26:36 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to bash8's documentation!
Welcome to bashate's documentation!
========================================================
Contents:

View File

@ -4,9 +4,9 @@ Installation
At the command line::
$ pip install bash8
$ pip install bashate
Or, if you have virtualenvwrapper installed::
$ mkvirtualenv bash8
$ pip install bash8
$ mkvirtualenv bashate
$ pip install bashate

View File

@ -2,6 +2,6 @@
Usage
========
To use bash8 in a project::
To use bashate in a project::
import bash8
import bashate

View File

@ -3,4 +3,4 @@
# The list of modules to copy from oslo-incubator.git
# The base module to hold the copy of openstack.common
base=bash8
base=bashate

View File

@ -1,5 +1,5 @@
[metadata]
name = bash8
name = bashate
summary = A pep8 equivalent for bash scripts
description-file =
README.rst
@ -18,14 +18,15 @@ classifier =
Programming Language :: Python :: 2.6
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
[files]
packages =
bash8
bashate
[entry_points]
console_scripts =
bash8 = bash8.bash8:main
bashate = bashate.bashate:main
[build_sphinx]
source-dir = doc/source
@ -36,15 +37,15 @@ all_files = 1
upload-dir = doc/build/html
[compile_catalog]
directory = bash8/locale
domain = bash8
directory = bashate/locale
domain = bashate
[update_catalog]
domain = bash8
output_dir = bash8/locale
input_file = bash8/locale/bash8.pot
domain = bashate
output_dir = bashate/locale
input_file = bashate/locale/bashate.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = bash8/locale/bash8.pot
output_file = bashate/locale/bashate.pot