diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f66e50ecbc..b50d65211f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: doc8 - repo: https://github.com/adrienverge/yamllint.git - rev: v1.26.0 + rev: v1.26.1 hooks: - id: yamllint exclude: > @@ -54,7 +54,7 @@ repos: types: [file, yaml] entry: yamllint --strict - repo: https://github.com/pre-commit/mirrors-isort - rev: v5.7.0 + rev: v5.8.0 hooks: - id: isort args: @@ -65,8 +65,8 @@ repos: hooks: - id: black language_version: python3 -- repo: https://gitlab.com/pycqa/flake8.git - rev: 3.8.4 +- repo: https://github.com/pycqa/flake8.git + rev: 3.9.0 hooks: - id: flake8 language_version: python3 diff --git a/docs/conf.py b/docs/conf.py index 9295e17a66..1bc8484650 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -84,7 +84,20 @@ # General substitutions. project = 'Ansible Lint Documentation' -copyright = "2013-2020 Ansible, Inc" # pylint: disable=redefined-builtin +copyright = "2013-2021 Ansible, Inc" # pylint: disable=redefined-builtin + +github_url = "https://github.com" +github_repo_org = "ansible" +github_repo_name = "ansible-lint" +github_repo_slug = f"{github_repo_org}/{github_repo_name}" +github_repo_url = f"{github_url}/{github_repo_slug}" + +extlinks = { + "issue": (f"{github_repo_url}/issues/%s", "#"), + "pr": (f"{github_repo_url}/pull/%s", "PR #"), + "commit": (f"{github_repo_url}/commit/%s", ""), + "gh": (f"{github_url}/%s", "GitHub: "), +} # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -154,6 +167,29 @@ html_theme_path = ['../_themes'] html_theme = 'sphinx_ansible_theme' + +html_theme_options = { + "collapse_navigation": False, + "analytics_id": "UA-128382387-1", + "style_nav_header_background": "#5bbdbf", + "style_external_links": True, + # 'canonical_url': "https://docs.ansible.com/ansible/latest/", + 'vcs_pageview_mode': 'edit', + "navigation_depth": 3, +} + +html_context = { + 'display_github': 'True', + 'github_user': 'ansible-community', + 'github_repo': 'ansible-lint', + 'github_version': 'master/docs/', + 'current_version': version, + 'latest_version': 'latest', + # list specifically out of order to make latest work + 'available_versions': ('latest', 'stable'), + 'css_files': (), # overrides to the standard theme +} + html_short_title = 'Ansible Lint Documentation' # The style sheet to use for HTML and HTML Help pages. A file of that name diff --git a/src/ansiblelint/utils.py b/src/ansiblelint/utils.py index d6094ddf36..4862b8a720 100644 --- a/src/ansiblelint/utils.py +++ b/src/ansiblelint/utils.py @@ -689,9 +689,9 @@ def compose_node(parent: yaml.nodes.Node, index: int) -> yaml.nodes.Node: # the line number where the previous token has ended (plus empty lines) line = loader.line node = Composer.compose_node(loader, parent, index) # type: ignore - node.__line__ = line + 1 if not isinstance(node, yaml.nodes.Node): raise RuntimeError("Unexpected yaml data.") + setattr(node, '__line__', line + 1) return node def construct_mapping(