Commit Graph

36 Commits

Author SHA1 Message Date
niuke 47788ab5b5 remove unicode literal from code
Change-Id: Ic897d7d55331fa81819f2e92aa3cc12e5661ce54
2022-07-30 15:30:49 +08:00
Hervé Beraud fbe3f2fe7c Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I7ac1599e903577e28fb64bb07a6b984e1ff8a023
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 15:05:13 +02:00
Andreas Jaeger 7ee77130c4 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Disable openstackdocs_auto_name to use 'project' variable as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I5f985549671e3b4f8c438f247fae0818d25b21f5
2020-05-29 12:45:49 +02:00
Zuul 64c33f3bb4 Merge "Remove some commented obsolete lines" 2019-08-16 11:00:53 +00:00
Andreas Jaeger a031fd772e Publish to publish-docs/html
Publish to publish-docs/html to simplify our doc building and publishing
CI jobs.

Change-Id: I8beb68195a7beaa3f2c125ef83db0fa589837639
2019-08-15 06:30:48 +02:00
Andreas Jaeger 918cec0047 Remove some commented obsolete lines
Addressing feedback from
https://review.opendev.org/675762 . These comments are wrong
with current openstackdocstheme, so remove them completely.

Change-Id: Ibfb3a2e37ea5b89ce81caed3e4884ee077e0d967
2019-08-13 18:13:26 +02:00
Andreas Jaeger 06d7ac27b7 Update docs building
Use sphinx-build and cleanup unused config.
Switch to openstackdocstheme 1.20.0 and remove obsolete settings from
conf.py files.

Update some RST files, they had wrong indentation.

Change-Id: Iaad2841db809f8a343fb8b1031cf8d0587d70442
2019-08-11 09:48:06 +02:00
zhouxinyong e1cd64caef Advancing the protocal of the website to HTTPS in README.rst.
Change-Id: I42c644e1e76c161ef0bd7473bf3996cb485f03e4
2018-11-14 01:11:46 +08:00
Stephen Finucane d3c952064a Remove 'autogenerate_config_docs'
This tool has been superseded by the 'oslo_config.sphinxext' Sphinx
extension and can finally be put to rest.

[1] https://docs.openstack.org/oslo.config/latest/reference/sphinxext.html

Change-Id: Idae5ba656c3a0da8a26c6f1e63332365c8012c0b
2017-10-04 11:47:56 +01:00
Andreas Jaeger c3bf1aa507 Switch to openstackdocstheme
Update to use current openstackdocstheme everywhere instead of
oslosphinx, remove now obsolete settings.

Change-Id: I812f72ebf9fb4d96b1031880c44596833da9d384
2017-06-27 22:59:01 +02:00
Jenkins 88514f2f1c Merge "Update docs theme configuration" 2017-05-01 12:14:48 +00:00
Andreas Jaeger 00ed2ea161 Update index page
Remove entries that have no content, rename indices section to search
since that is the remaining entry.

Change-Id: I167caa2cc0e99d370ca3ea10edd96fe1ba482d54
2017-05-01 10:16:47 +02:00
Andreas Jaeger ea1ae95b63 Update docs theme configuration
Enable log-a-bug feature and add information on when document was built.

Disable pep8 check for doc/source/conf.py.

Change-Id: Ia86791ac69845572b2fbc536732afcf901bcf203
2017-04-30 09:30:39 +02:00
Brian Moss d3bc42483a Update sitemap tests
- add py3 to tox.ini (gate already tests py3)
- move all tests to $GITROOT/test so they can all run
  through testr
- add scrapy to test-requirements.txt to support sitemap tests
- move tests from test_items.py to test_sitemap_file.py
- fix broken sitemap tests
- add newton to list of old releases in sitemap_file.py
- ignore flake8 H101 as it returns false positives for Sphinx conf.py
- Use openstackdocstheme for docs
- Update sitemap README
- Restructure repo docs
- fix minor style issues

Change-Id: I22c018149b2eefde6ca5c38c22ac06886fe9a7a8
2017-04-29 10:36:27 +10:00
Alexis Lee 3f8ed82319 Gen autogenerate_config_docs/README.rst
Link from index and main README.

Change-Id: Iad0a72544eb4849f0823029d6f7523e421ddc9e0
2016-11-15 13:29:20 +00:00
Andreas Jaeger fe586291ff Remove openstack-doc-test
openstack-doc-test is used for building of DocBook XML files. For index
page generation openstack-indexpage can be used.

Remove openstack-doc-test together with all support files.

Change-Id: I5589bc634e1f630f79b3d6e8bffee939c5300bf2
2016-05-19 01:51:03 +00:00
ZhiQiang Fan c6da54a2ad Remove executable privilege of doc/source/conf.py
It is a configuration file, rather than a script.

Change-Id: I5d0eaf7bf47084e1bcb77a85fdb2c88c724ae25b
2016-04-30 03:45:06 +00:00
Atsushi SAKAI 2cd6d5902b [openstack-doc-tools] fix one typo
depenencies => dependencies

Change-Id: I3b8a46f816c9e91ec7755be3a4749a4ce0693970
Closes-Bug: #1483135
2015-08-10 15:50:37 +09:00
Andreas Jaeger 175e79ebf7 Run doc8 as part of pep8 test
Fix all issues found and enable doc8 run.

Change-Id: I1b3fc9ac3db5e2d1dfa138b026e26835ead4d7fb
2014-08-17 06:51:54 +02:00
Andreas Jaeger 9f97944f2d Do not abort on first failure
If multiple check arguments are given, do not exit after first failure
but continue and report all failed tests.
Enhance profile check to not abort after the first error.
Remove option --ignore-errors, this is not needed anymore.

Change-Id: I79996258a5d53b42cd57b11a0940ea4d6d18af5a
2014-08-12 07:13:48 +02:00
Andreas Jaeger 753876d9e4 Add check for links
Add new option --check-links that checks that links are valid
and reachable.

Change-Id: I1a709bcbf47c7fdfbdc5e4da55457d7ccb70604c
Co-Authored-By: Christian Berendt <berendt@b1-systems.de>
2014-08-11 11:30:39 +02:00
Christian Berendt 9a1b2e1731 Move release notes into a separate file
Change-Id: I179e3b304f63fa2c9b513c08087532aab9ef2112
2014-07-28 22:04:02 +02:00
Jenkins ae3d8aa0e7 Merge "remove definitions of Python Source Code Encoding" 2014-06-03 23:53:43 +00:00
Christian Berendt a8758819e5 cleaning up index.rst file
Removed notes about the generation of the file.

Change-Id: Ie63f714d321afce619096e0deb645767397ec5d9
2014-05-29 10:56:27 +02:00
Christian Berendt e896108eb3 remove definitions of Python Source Code Encoding
I think PEP 0263 (http://legacy.python.org/dev/peps/pep-0263/) is
not used anywhere else and so it should be removed.

Change-Id: Ib9c64054338fdc6d414b0d4a28b35b562ac427a7
2014-05-23 12:10:19 +02:00
Christian Berendt 70fb1ca1fc fixed pep8 issues in doc/source/conf.py
* E265 block comment should start with '# '
  * E101 indentation contains mixed spaces and tabs
  * W191 indentation contains tabs
  * E126 continuation line over-indented for hanging indent
  * W391 blank line at end of file

Also enabled doc/ to be checked by flake8 in tox.ini.

Change-Id: I6ef75ccffb94dd2df346e844d351ea477e560a42
2014-05-13 22:51:56 +02:00
Andreas Jaeger 6659c80435 Improve api-site handling for openstack-doc-test
Find books that need to be rebuild for api-site better:
* Handle include of wadl resources.
* Handle file layout of api-site.

Add new option --print-unused-files.

Change-Id: I8ad61cf53728e3b5ba71077bf53b1780a2535c2e
2014-04-23 14:42:52 +02:00
Andreas Jaeger cbd65025c9 Handle www pages properly when publishing
www is copied to publish-dir/www but this is not desired when publishing
for our external website - only for drafts.

Add option --publish for publishing to external website
that does not copy www over and also always builds manuals.

Change-Id: I9972a690c6c714fbe028b47ff1da2884d058282b
2014-04-17 07:34:37 +02:00
Andreas Jaeger 3ee6441938 Add new option --build-file-exception to openstack-doc-test
This allows to ignore files just for syntax and niceness checks
but still use them for calculation of dependencies.

This allows us to handle the training-guide where st-training-guides.xml
should be black-listed for syntax checks but needs to be used for
dependency calculation in delete and build checks.

Change-Id: Ib183e635b623218083447e85fe8a6b0cb278a9e6
2014-03-02 19:28:13 +01:00
Andreas Jaeger 15601d407c Fix error reporting of doctest and parallel builds
Fix error handling in openstack-doc-test, now really abort if an
error occurs. The call to write in the exception was wrong and masked
the exception.

OpenStack infra changed the setup so that we now always destroy a node
after building - and thus have a clean node each time.
Now, when mvn is called, it needs to download lots of files into the
.ml2 repository (previously this was done already).
Now, the cripts start mvn jobs in parallel - and then we get a race
between these downloads and corruption of the .m2 directory.
Avoid this race with waiting for the first build job to finish before
starting further builds.

Add options --parallel/--noparallel to disable parallel building
completely.

Improve debug output.

Related-Bug: #1277082

Change-Id: Ifa62e0bb5b4f655b0d36b9e16bb0bb8adcd4cbd5
2014-02-22 12:14:15 +01:00
Andreas Jaeger bcde96e16d Generate a log file for each built book
Generate a log file build-${book}.log.gz for each book in the top-level
directory.

Also, add --debug option that for now only serializes the built to
see errors in the build_book invocation.

Change-Id: I1d81eaefa15f0d6bc103b9d3adbbf12b092ba7e6
2014-02-08 22:18:56 +01:00
Andreas Jaeger 131a50461b Handle translations
Add a new option -l LANGUAGE to build and publish localized content
that is in generated/$LANGUAGE and copy content to
publish_docs/$LANGUAGE.

Add new option --only-book to build only specific manual.

Read gerrit-doc.properties if exists to pass values to maven.

Change-Id: I6a07fe02428679d0e5e00a4d67f1b11d9c85b262
2014-02-04 21:47:30 +01:00
Andreas Jaeger 5b4186cf0b Copy all generated books to common path
Copy all generated books to directory publish-docs in the git top-level
so that Jenkins can publish them on docs-draft.

Also copies www directory over if files in it where changed.

The tool now uses a config-file "doc-test-conf" which is expected in the
top-level of the repository.

blueprint draft-docs-on-docs-draft

Change-Id: Iea67050d827407f2f71585372c673f7f1dbccc46
2014-02-03 22:45:46 +01:00
Andreas Jaeger 758819a77b Add option --exceptions-file
This allows a per-project exceptions file.

Once this is released, the current static file list can be moved
to an openstack-manuals specific file.

This is needed to ignore some files in the database-api repository, see
https://review.openstack.org/67716 and
https://review.openstack.org/#/c/67585.

Change-Id: Iab1c7b11680d9785b202b80fa80805b2069ea896
Related-Bug: #1270267
2014-01-20 10:11:20 +01:00
Andreas Jaeger f0c6cd4871 Add parameter --ignore-dir
This allows to ignore directories, e.g.
ignore in compute api the incubation and v1 dirs with:

openstack-doc-test --check-build --api-site \
  --ignore-dir=incubation --ignore-dir=openstack-compute-api-1.0

Change-Id: I6bad41543ed2269217a2ed36fcd947b83707daf2
2014-01-07 09:39:58 +01:00
Andreas Jaeger 93be0e5e62 Use sphinx for documentation of openstack-doc-tools
Update for using sphinx package so that documentation
follows the OpenStack python packaging conventions.

This contains an initial man page for the openstack-doc-test
tool.

Change-Id: I8b8ed63c3c7bcfb58f5d8f939a79c3f7c314b969
2014-01-03 12:19:40 +01:00