Commit Graph

126 Commits

Author SHA1 Message Date
Tony Breeds 3cce21151f Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I413fea5768aec05e892d7977abadc279a06e1dcc
2017-09-12 15:56:10 -06:00
Andreas Jaeger 06dd472f0a Fix formatting of contributor page
Do not indent the URLs, so that sphinx marks them properly.

Change-Id: I0eb40211cee3fb34e85d47bbb81f697d9ab85127
2017-07-21 08:57:28 +02:00
Andreas Jaeger 311b320214 Treat sphinx warnings as errors
The repo builds without warnings, enable treating warnings as error to
keep the state.

Change-Id: I785e2333b9c457ea39e851d9d0e23cff2fca105d
2017-07-21 08:54:46 +02:00
Andreas Jaeger 1e8a55ea10 Reorder content to follow new structure
Follow the new common docs structure and rearrage content for it.

Change-Id: I7c52236863a8b27656fcbf5870e3ff8dfa726955
2017-07-21 08:54:40 +02:00
Andreas Jaeger 465ed7e25f Update to openstackdocstheme
Use openstackdocstheme everywhere, this implies updating some
requirements.

Change-Id: I41db61936be63f92022c3f32cf6468a503e03dff
2017-07-21 08:43:47 +02:00
Jenkins 726d89864a Merge "Update to tox.ini environment list" 2017-04-07 00:46:28 +00:00
Mathew Odden e36016977c Update to tox.ini environment list
We officially support python35 now, so add py35
to the default envlist.

Also, just clean up the default list by removing
py33, py34, and pypy. I used to test by hand on py34
a long time ago, but I don't see much risk in breaking
this with python35 gating jobs.

I don't know of anyone attempting to run this on pypy
and I don't know if anyone has ever tested it either.

Change-Id: Ic9a98b2e126c9366cd325d8f47860d556bbb69ee
2017-04-06 09:20:27 -05:00
Andrea Frittoli b1b84d90ec Add py3.5 support in setup.cfg
As defined in https://governance.openstack.org/tc/goals/pike/python35.html
Pike community goal for py35, adding py35 to setup.cfg.

Change-Id: If4a7fd855abe96b1b67a6d29f62d5b8ccf01abc8
2017-04-06 09:53:34 +01:00
Riccardo Pittau ebc1f46a82 correcting typo in EXAMPLES section
-I should be -i

Change-Id: I442f9247d869329a64d03b53c0619acdfd394fdc
2017-04-05 18:01:51 +02:00
Ihar Hrachyshka a013bad830 docs: fixed CLI args description
There is no -I argument, it's -i instead. Also, documented -w and -e
arguments.

Change-Id: I30f8682f5be3c08b0bce4f7cb0d6659f342b4621
2017-03-06 03:34:23 +00:00
Jenkins dd50cb9522 Merge "Update .coveragerc after the removal of openstack directory" 2017-02-09 05:58:18 +00:00
Jenkins a23cd09114 Merge "Don't include openstack/common in flake8 exclude list" 2017-02-09 05:57:37 +00:00
nizam 6c3473b0da Update .coveragerc after the removal of openstack directory
The openstack directory was used to keep codes from oslo-incubator,
we have retired oslo-incubator,so don't use this directory any more.

Change-Id: Id131b7147839cb5961454fad4837ea6385592304
2016-10-21 23:49:28 +05:30
nizam f08463bf20 Changed the home-page link
Set the correct link for home-page.

Change-Id: I69815e30242b9f65e514ebe77cee862d79f310ef
2016-10-21 23:45:35 +05:30
nizam 31a8dcd71c Don't include openstack/common in flake8 exclude list
The directory openstack/common was used to keep codes from oslo-incubator,
we have retired oslo-incubator,so don't use this directory any more.

Change-Id: I811306b0068e8adecf63995c9d47d6cb4b11a3c6
2016-10-21 23:37:25 +05:30
Andreas Jaeger dc419beb2d Enable release notes translation
Releasenote translation publishing is being prepared. 'locale_dirs'
needs to be defined in conf.py to generate translated version of the
release notes.

Note that this repository might not get translated release notes - or
no translations at all - but we add the entry here nevertheless to
prepare for it.

Change-Id: I512878af85887d8cb7e8b241797ff611a35972c1
2016-10-06 20:21:20 +02:00
Jenkins 83611280ed Merge "Exclude hashbangs check for .bashrc, .bash_profile, etc" 2016-07-15 04:31:46 +00:00
Ryan Selden 73da957f50 Update docs to include all errors
Error code E005 wasn't documented in README
This will also update to the OpenStack docs:
http://docs.openstack.org/developer/bashate/readme.html

Change-Id: I4bc2eda86d1c000195d075bafe2c819ce9a871aa
Closes-Bug: #1554709
2016-07-11 20:14:31 +00:00
Tin Lam 3b798e0729 Exclude hashbangs check for .bashrc, .bash_profile, etc
Remove E005 errors for hidden configuration files that do not
end with .sh, e.g., .profile, .bashrc, .bash_profile, etc.

Change-Id: I57d5b556cbc8843b744d3276a1dfdd7467d74fde
Closes-Bug: #1554653
2016-04-30 07:31:59 +00:00
Ian Wienand 3e76bce89d Add releasenote on python3
Add note that we've fixed up python3 from here on out.  CI testing
with I76d298ee8a1eb36358f1a9b49c0edfd73ade02a2

Change-Id: I0ac4c5b2c5bdacaaa0926041d11456472ffc08b6
2016-04-26 16:05:02 +10:00
Ian Wienand 2a61ab8948 Add releasenotes venv
We don't do the releasenotes as part of the doc build because it makes
things hard for packagers.  This is the standard way to do it now and
we can setup jobs to publish them.

Change-Id: I6384f53a7604a5adc5d7282f2ae33945df1c88d0
2016-04-26 15:47:29 +10:00
Ian Wienand 28a2f9b995 Fix python3 parsing of subprocess output
As described in the python docs, use "universal_newlines" to
subprocess so the output are text streams.

With this, tox -e py34 works

Change-Id: I79091ed98054f25414d99824ee686bdf38ab968e
2016-04-26 10:55:13 +10:00
Ian Wienand 0661da9c91 Add reno & start at release notes
Add reno & start at having release notes

Change-Id: I747ccfd87cc56e0797ec899097a6e338c720692e
2016-03-07 13:08:39 +11:00
Adam Spiers 7d00195eff Ensure that E006 allows long continuation lines
Since bashate has code which compiles multiple physical lines with
continuation backslashes into single logical lines, and then runs checks
on those, there is a (small) danger of future code changes causing the
E006 check to be incorrectly applied to long logical lines instead of
the shorter physical lines.  Currently it all works fine, but there
could be a regression, so add a new test prevents that regression, by
explicitly requiring E006 to allow >=80 character logical lines which
are comprised of <80 character physical lines.

Signed-off-by: Adam Spiers <aspiers@suse.com>
Change-Id: I3d6ffca64b21f86921f13e06d24c8b942c16d4c4
2016-03-02 10:58:07 +00:00
Ian Wienand 6d166755b3 Fix final newline testing
Since we don't use the fileinput loop since
I781c1b642eb15fc7e2914791d5b77e8a4752db79, we can just check the last
line of the file before we start reading the next file (using the
bulitin fileinput loop tells you when a new file starts, but doesn't
tell you went a file ends, hence this work-around).

Which is actually the correct thing to do, because as it is, you can't
detect the lack-of-newline unless you're checking two files.  This
removes a bunch of prev_* variables that aren't needed.  This is also
I think why we never had a test-case.  So fix that too.

Change-Id: I54963cd25efc9f9603fbcc60b8e25bb11ea2d7db
2016-02-16 16:04:06 +11:00
Ian Wienand afd4d14ef7 Detect arithmetic compound
As described in comments, ((expr)) has a trap that if expr is 0, the
return value is 1.  This will trigger a failure with "set -e" and can
be very confusing.  It is good defensive programming to avoid this
with explicit assignment.

Change-Id: Id57df3ff8127601429426c177a10e8eaec30c504
2016-02-09 15:16:14 +11:00
Ian Wienand 3e72c41ba8 Tighten up local result-hiding check
Also match on

 local foo="$(bar)"

which hides the return value of "bar" (this popped up in a devstack
review).

Change-Id: I18e985d3e4cf87eb7ac54d6341355ee8b30d9349
2016-02-09 15:09:23 +11:00
Ian Wienand e43f4a2765 Handle argument line-up in continuations
Emacs in particluar does some indenting where it will try to align
continued lines up with the first argument, e.g.

  a_long_command arg1 \
                 arg2 arg3

Our current check will just barf on this when the offset isn't a
multiple of 4.  By passing "logical_line" to the offset checker, we
can find the first argument on the first line, and allow the whole
thing through if everything lines up.

Change-Id: I7f3369e4888353d2ba4ba2e48f3aaec4d1135b53
2016-02-09 15:09:21 +11:00
Ian Wienand 8e13bd115a Cleanup continuation line handling
Rework things to collect continuation lines into "logical_lines".  We
convert this to an array (holding all lines of the continuation) for
simplicity.

For now, retain the status quo by running the existing checks over
each line as before.  However, this gives us the flexibility to do
different things for continuations, like allow different offsets.

Change-Id: I7bee246c9fd77ccdc4be3c2ba605d54d6fb81c86
2016-02-09 14:59:50 +11:00
Ian Wienand 649c7dc799 Ignore heredoc contents
I noticed that we end up treating a heredoc as one big logical line,
then passing it through things like the line-length check.  So

cat <<EOF
this is normal lines
that get picked up as a long line!
EOF

end up triggering the long-line exception ... clearly not what is
intended.

In fact, there's not much we can do with heredocs.  They are usually
some weird syntax for a config file, or something else you're writing
out in bulk.  Often they have offsets that just don't match what we
want, etc.

Thus most logical thing to do seems to be to just ignore whatever is
in the heredoc.

I also noticed we don't handle <<'EOF', which is another common idiom,
so add that to the regex.  Also add a test-case to ensure we're
ignoring the heredoc contents.

Change-Id: I2e3d66f27ff4c0d1f542511ca3e19c29a596896f
2016-02-09 14:57:30 +11:00
Ian Wienand 5c7a3a125a Replace heredoc fail-to-end detection E012 with "bash -n"
Currently E012 (detect if heredoc doesn't end) basically doesn't work;
it relies on having multiple files specified to check.  The logic is
currently that if a heredoc is open and we start a new-file, we missed
it.

As we even say in the comments, bash will warn about this.  Luckily,
"bash -n" does pop out this warning when we forget to close a
heredoc.

So modify the existing bash syntax check to catch this too.  Because
it's a warning, bash doesn't exit with !0, so rework things to just
parse output in all cases.  I also found a bit of inconsistency with
output, as described in the comments.

Remove the existing check, and add a testcase.

Change-Id: I292a926d3297a283f74f7d47b7c7aa3c42c9f030
2016-02-09 14:57:25 +11:00
Andreas Jaeger 2161c6353f Remove argparse from requirements
argparse was external in python 2.6 but not anymore, remove it from
requirements.

This should help with pip 8.0 that gets confused in this situation.
Installation of the external argparse is not needed.

Change-Id: Ib7e74912b36c1b5ccb514e31fac35efeff57378d
2016-01-20 19:28:54 +01:00
Jenkins 23507e3721 Merge "Set up locale for bash syntax testing" 2016-01-05 18:07:34 +00:00
Andreas Jaeger eefd65fd29 Update requirements
Update requirements with global requirements so that this is compatible
with other development tools. Right now the requirement on pbr forces
a downgrade of pbr - see
http://lists.openstack.org/pipermail/openstack-dev/2016-January/083297.html

Change-Id: Ica86a4fd23e47b901537af02807bbb104c4ed578
2016-01-05 08:38:31 +01:00
Jenkins 281bba3ebd Merge "Removes MANIFEST.in as it is not needed explicitely by PBR" 2016-01-04 21:29:16 +00:00
Jenkins b904d35bd0 Merge "Drop py26 support" 2016-01-04 12:09:04 +00:00
sonu.kumar a92858d0d0 Removes MANIFEST.in as it is not needed explicitely by PBR
This patch removes `MANIFEST.in` file as pbr generates a sensible
manifest from git files and some standard files and it removes
the need for an explicit `MANIFEST.in` file.

Change-Id: I26c60c0235a959ba565693df0b7f05b77ccdd530
2015-12-15 14:53:29 +05:30
sonu.kumar ca1a8080e6 Drop py26 support
as of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,

Change-Id: I352fe202a1f954b52e8e9ef8bc0a20f729ac17be
2015-12-15 14:52:06 +05:30
Dirk Mueller 50147f329d Set up locale for bash syntax testing
When bashate is run in a non-posix locale environment,
the bash syntax check is failing since bash does not
returns the localized error message, which we can
not detect. Enforce a known good locale.

Change-Id: I4a9423927eb7d526fd3549aef2305088b51d9b1f
2015-11-20 22:41:08 +01:00
Ian Wienand bea415871a Only warn about tab-indent
I noticed this in I21d3c2ad7a020a5ab02dc1ab532feae70b718892 ; if you
have a tab-indent, we don't need to warn that the same line is also
not indented correctly

Change-Id: If0499126fc64861de971f851e2715d4379bd9dee
2015-10-20 11:57:14 +11:00
Nikki Heald 77da51f026 Add shallow syntax checking
`bash -n` will do a shallow syntax check on a bash script,
just checking that the script parses. It's possible to have
scripts that pass all bashate style checks, but don't actually
run because of a syntax error, so this adds error code E040
and reports the syntax errors that `bash -n` outputs.

Change-Id: Ib128c54493221e71cca19a497a6efc4f5fc368c1
2015-10-15 16:50:06 +01:00
Ian Wienand 1d949d6e3e Detect setting locals with subshell commands
The return status of "local" is always 0, so something like

 local foo=$(failing command)

doesn't trigger a failure under "set -e".  Missing "failing command"'s
failure has been a source of problems within devstack.

This is added as a warning

Change-Id: Ia0957b47187c3dcadd46154b17022c4213781112
2015-10-06 20:30:04 +11:00
Monty Taylor e04cb43ca5 Change ignore-errors to ignore_errors
Needed for coverage 4.0

Change-Id: I1f48320e6064bce66bacb6f34fe81e11d9dbfd7e
2015-09-21 09:12:25 -05:00
Jenkins bb1eb380b3 Merge "add E006: check for lines longer than 79 columns" 2015-07-31 01:18:38 +00:00
Joe Gordon 8e6f4c733d Move to hacking 0.10
Release notes:
http://lists.openstack.org/pipermail/openstack-dev/2015-January/054165.html

Removed deleted hacking rules from tox.ini

Change-Id: I48c76568556928dbead2c5e75da107e8b8dd6e12
2015-06-05 14:16:32 +09:00
Adam Spiers 625fdaf2c4 add E006: check for lines longer than 79 columns
This mimics the widely accepted convention from PEP8 and many other
places that lines longer than 79 columns can not only cause problems
when reading/writing code, but also often indicate a bad smell,
e.g. too many levels of indentation due to overly complex functions
which require refactoring into smaller chunks.

Change-Id: Ic2532676e46e93f129d590d1fa7a044ef65f50fb
2015-05-04 17:58:37 +01:00
Matt Odden 77e8ad47de Cleanup variable names TODO
Take care of this TODO by renaming our non-constant
instance variables to something more descriptive.

Change-Id: I8ab9eb41180ef9c55c75bccb627413f2b717d217
2015-03-18 14:38:14 -05:00
Jenkins a14a7a313d Merge "Don't mock argparse" 2015-03-13 02:44:12 +00:00
Jenkins c3128fd6cd Merge "Fix broken py3 tests" 2015-02-26 22:16:14 +00:00
Jenkins 7b9457a2e5 Merge "Change test order to avoid incompatibliity" 2015-02-26 22:15:20 +00:00