-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from opsmill/develop
v0.0.4
- Loading branch information
Showing
35 changed files
with
1,862 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
# yamllint disable rule:truthy | ||
name: Release Note | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- stable | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-note.yml | ||
disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.INFRAHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
version: 2 | ||
# sphinx: | ||
# configuration: docs/conf.py | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ extends: default | |
ignore: | | ||
/.venv | ||
/examples | ||
/tests/**/output* | ||
rules: | ||
new-lines: disable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
# -*- coding: utf-8 -*- | ||
# pylint: disable=no-self-argument | ||
# | ||
|
||
# https://bitbucket.org/birkenfeld/pygments-main/raw/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/AUTHORS | ||
|
||
# | ||
# Licensed under BSD license: | ||
# | ||
|
||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are | ||
# met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
||
__metaclass__ = type | ||
|
||
|
||
from pygments import token | ||
from pygments.lexer import DelegatingLexer, RegexLexer, bygroups, include | ||
from pygments.lexers import DiffLexer | ||
|
||
|
||
class AnsibleOutputPrimaryLexer(RegexLexer): | ||
name = "Ansible-output-primary" | ||
|
||
# The following definitions are borrowed from Pygment's JSON lexer. | ||
# It has been originally authored by Norman Richards. | ||
|
||
# integer part of a number | ||
int_part = r"-?(0|[1-9]\d*)" | ||
|
||
# fractional part of a number | ||
frac_part = r"\.\d+" | ||
|
||
# exponential part of a number | ||
exp_part = r"[eE](\+|-)?\d+" | ||
|
||
tokens = { | ||
# ######################################### | ||
# # BEGIN: states from JSON lexer ######### | ||
# ######################################### | ||
"whitespace": [(r"\s+", token.Text)], | ||
# represents a simple terminal value | ||
"simplevalue": [ | ||
(r"(true|false|null)\b", token.Keyword.Constant), | ||
( | ||
("%(int_part)s(%(frac_part)s%(exp_part)s|" "%(exp_part)s|%(frac_part)s)") % vars(), | ||
token.Number.Float, | ||
), | ||
(int_part, token.Number.Integer), | ||
(r'"(\\\\|\\"|[^"])*"', token.String), | ||
], | ||
# the right hand side of an object, after the attribute name | ||
"objectattribute": [ | ||
include("value"), | ||
(r":", token.Punctuation), | ||
# comma terminates the attribute but expects more | ||
(r",", token.Punctuation, "#pop"), | ||
# a closing bracket terminates the entire object, so pop twice | ||
(r"\}", token.Punctuation, "#pop:2"), | ||
], | ||
# a json object - { attr, attr, ... } | ||
"objectvalue": [ | ||
include("whitespace"), | ||
(r'"(\\\\|\\"|[^"])*"', token.Name.Tag, "objectattribute"), | ||
(r"\}", token.Punctuation, "#pop"), | ||
], | ||
# json array - [ value, value, ... } | ||
"arrayvalue": [ | ||
include("whitespace"), | ||
include("value"), | ||
(r",", token.Punctuation), | ||
(r"\]", token.Punctuation, "#pop"), | ||
], | ||
# a json value - either a simple value or a complex value (object or array) | ||
"value": [ | ||
include("whitespace"), | ||
include("simplevalue"), | ||
(r"\{", token.Punctuation, "objectvalue"), | ||
(r"\[", token.Punctuation, "arrayvalue"), | ||
], | ||
# ######################################### | ||
# # END: states from JSON lexer ########### | ||
# ######################################### | ||
"host-postfix": [ | ||
(r"\n", token.Text, "#pop:3"), | ||
( | ||
r"( )(=>)( )(\{)", | ||
bygroups(token.Text, token.Punctuation, token.Text, token.Punctuation), | ||
"objectvalue", | ||
), | ||
], | ||
"host-error": [ | ||
( | ||
r"(?:(:)( )(UNREACHABLE|FAILED)(!))?", | ||
bygroups(token.Punctuation, token.Text, token.Keyword, token.Punctuation), | ||
"host-postfix", | ||
), | ||
(r"", token.Text, "host-postfix"), | ||
], | ||
"host-name": [ | ||
( | ||
r"(\[)([^ \]]+)(?:( )(=>)( )([^\]]+))?(\])", | ||
bygroups( | ||
token.Punctuation, | ||
token.Name.Variable, | ||
token.Text, | ||
token.Punctuation, | ||
token.Text, | ||
token.Name.Variable, | ||
token.Punctuation, | ||
), | ||
"host-error", | ||
) | ||
], | ||
"host-result": [ | ||
(r"\n", token.Text, "#pop"), | ||
( | ||
r"( +)(ok|changed|failed|skipped|unreachable)(=)([0-9]+)", | ||
bygroups(token.Text, token.Keyword, token.Punctuation, token.Number.Integer), | ||
), | ||
], | ||
"root": [ | ||
( | ||
r"(PLAY|TASK|PLAY RECAP)(?:( )(\[)([^\]]+)(\]))?( )(\*+)(\n)", | ||
bygroups( | ||
token.Keyword, | ||
token.Text, | ||
token.Punctuation, | ||
token.Literal, | ||
token.Punctuation, | ||
token.Text, | ||
token.Name.Variable, | ||
token.Text, | ||
), | ||
), | ||
( | ||
r"(fatal|ok|changed|skipping)(:)( )", | ||
bygroups(token.Keyword, token.Punctuation, token.Text), | ||
"host-name", | ||
), | ||
( | ||
r"(\[)(WARNING)(\]:)([^\n]+)", | ||
bygroups(token.Punctuation, token.Keyword, token.Punctuation, token.Text), | ||
), | ||
( | ||
r"([^ ]+)( +)(:)", | ||
bygroups(token.Name, token.Text, token.Punctuation), | ||
"host-result", | ||
), | ||
( | ||
r"(\tto retry, use: )(.*)(\n)", | ||
bygroups(token.Text, token.Literal.String, token.Text), | ||
), | ||
(r".*\n", token.Other), | ||
], | ||
} | ||
|
||
|
||
class AnsibleOutputLexer(DelegatingLexer): | ||
name = "Ansible-output" | ||
aliases = ["ansible-output"] | ||
|
||
def __init__(self, **options): | ||
super(AnsibleOutputLexer, self).__init__(DiffLexer, AnsibleOutputPrimaryLexer, **options) | ||
|
||
|
||
# #################################################################################################### | ||
# # Sphinx plugin #################################################################################### | ||
# #################################################################################################### | ||
|
||
__version__ = "0.1.0" | ||
__license__ = "BSD license" | ||
__author__ = "Felix Fontein" | ||
__author_email__ = "[email protected]" | ||
|
||
|
||
def setup(app): | ||
"""Initializer for Sphinx extension API. | ||
See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions. | ||
""" | ||
for lexer in [AnsibleOutputLexer(startinline=True)]: | ||
app.add_lexer(lexer.name, lexer) | ||
for alias in lexer.aliases: | ||
app.add_lexer(alias, lexer) | ||
|
||
return dict(version=__version__, parallel_read_safe=True) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.