From a2815dd86fc56e16bec783ed904aba65b27de7ac Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Fri, 20 Jun 2014 15:06:22 -0400 Subject: [PATCH] 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 --- .coveragerc | 4 +- HACKING.rst | 4 +- README.rst | 4 +- {bash8 => bashate}/__init__.py | 2 +- bash8/bash8.py => bashate/bashate.py | 6 +-- {bash8 => bashate}/tests/__init__.py | 0 {bash8 => bashate}/tests/base.py | 0 {bash8 => bashate}/tests/samples/E001_bad.sh | 0 {bash8 => bashate}/tests/samples/E002_bad.sh | 0 .../tests/samples/legacy_sample.sh | 0 .../tests/test_bashate.py | 54 +++++++++---------- doc/source/conf.py | 8 +-- doc/source/index.rst | 4 +- doc/source/installation.rst | 6 +-- doc/source/usage.rst | 4 +- openstack-common.conf | 2 +- setup.cfg | 19 +++---- 17 files changed, 59 insertions(+), 58 deletions(-) rename {bash8 => bashate}/__init__.py (95%) rename bash8/bash8.py => bashate/bashate.py (97%) rename {bash8 => bashate}/tests/__init__.py (100%) rename {bash8 => bashate}/tests/base.py (100%) rename {bash8 => bashate}/tests/samples/E001_bad.sh (100%) rename {bash8 => bashate}/tests/samples/E002_bad.sh (100%) rename {bash8 => bashate}/tests/samples/legacy_sample.sh (100%) rename bash8/tests/test_bash8.py => bashate/tests/test_bashate.py (68%) diff --git a/.coveragerc b/.coveragerc index f9a9cf2..35ff486 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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 \ No newline at end of file diff --git a/HACKING.rst b/HACKING.rst index d25b8e5..447beac 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -1,4 +1,4 @@ -bash8 Style Commandments +bashate Style Commandments =============================================== -Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ \ No newline at end of file +Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ diff --git a/README.rst b/README.rst index e81cef6..ba766fd 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/bash8/__init__.py b/bashate/__init__.py similarity index 95% rename from bash8/__init__.py rename to bashate/__init__.py index d2fd383..1b71913 100644 --- a/bash8/__init__.py +++ b/bashate/__init__.py @@ -16,4 +16,4 @@ import pbr.version __version__ = pbr.version.VersionInfo( - 'bash8').version_string() + 'bashate').version_string() diff --git a/bash8/bash8.py b/bashate/bashate.py similarity index 97% rename from bash8/bash8.py rename to bashate/bashate.py index 99d348b..654510d 100644 --- a/bash8/bash8.py +++ b/bashate/bashate.py @@ -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 diff --git a/bash8/tests/__init__.py b/bashate/tests/__init__.py similarity index 100% rename from bash8/tests/__init__.py rename to bashate/tests/__init__.py diff --git a/bash8/tests/base.py b/bashate/tests/base.py similarity index 100% rename from bash8/tests/base.py rename to bashate/tests/base.py diff --git a/bash8/tests/samples/E001_bad.sh b/bashate/tests/samples/E001_bad.sh similarity index 100% rename from bash8/tests/samples/E001_bad.sh rename to bashate/tests/samples/E001_bad.sh diff --git a/bash8/tests/samples/E002_bad.sh b/bashate/tests/samples/E002_bad.sh similarity index 100% rename from bash8/tests/samples/E002_bad.sh rename to bashate/tests/samples/E002_bad.sh diff --git a/bash8/tests/samples/legacy_sample.sh b/bashate/tests/samples/legacy_sample.sh similarity index 100% rename from bash8/tests/samples/legacy_sample.sh rename to bashate/tests/samples/legacy_sample.sh diff --git a/bash8/tests/test_bash8.py b/bashate/tests/test_bashate.py similarity index 68% rename from bash8/tests/test_bash8.py rename to bashate/tests/test_bashate.py index 3068f85..bd51156 100644 --- a/bash8/tests/test_bash8.py +++ b/bashate/tests/test_bashate.py @@ -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 diff --git a/doc/source/conf.py b/doc/source/conf.py index bd640ad..110f6a2 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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} \ No newline at end of file +#intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/source/index.rst b/doc/source/index.rst index 6dfea5d..ac780dc 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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: diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 2c851bf..9ac5592 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -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 \ No newline at end of file + $ mkvirtualenv bashate + $ pip install bashate diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 68d5f9f..b1d822d 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -2,6 +2,6 @@ Usage ======== -To use bash8 in a project:: +To use bashate in a project:: - import bash8 \ No newline at end of file + import bashate diff --git a/openstack-common.conf b/openstack-common.conf index 572c730..6aa4cb3 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -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 \ No newline at end of file +base=bashate \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 98e4853..8d13dec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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