Skip to content

Commit

Permalink
Sync master
Browse files Browse the repository at this point in the history
This commit was automatically generated by the upstream build.

Upstream-Commit: f0f12d397e3836533546bceded336102e8cc96ca
  • Loading branch information
Travis CI User committed Jul 17, 2020
1 parent f236f3b commit a81eff1
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 9 deletions.
2 changes: 2 additions & 0 deletions bits/common-usage.txt
Expand Up @@ -5,6 +5,8 @@ Options affecting listfile parsing:
Specify property tags.

Options affecting formatting.:
--disable [DISABLE] Disable formatting entirely, making cmake-format a no-
op
--line-width LINE_WIDTH
How wide to allow formatted cmake files
--tab-size TAB_SIZE How many spaces to tab for indent
Expand Down
36 changes: 33 additions & 3 deletions bits/configbits.py
Expand Up @@ -4,19 +4,34 @@
with section("parse"):

# Specify structure for custom cmake functions
additional_commands = { 'cc_binary': { 'kwargs': { 'DEPS': '*',
additional_commands = { 'cc_binary': { 'flags': ['ADD_RUNTARGET'],
'kwargs': { 'DEPS': '*',
'PKGDEPS': '*',
'PROPERTIES': { 'kwargs': { 'EXPORT_NAME': 1,
'OUTPUT_NAME': 1}},
'SRCS': '*'},
'pargs': '1+'},
'cc_library': { 'flags': ['STATIC', 'SHARED'],
'kwargs': { 'DEPS': '*',
'kwargs': { 'DEPS': { 'kwargs': { 'INTERFACE': '*',
'PRIVATE': '*',
'PUBLIC': '*'},
'pargs': '*'},
'INC': { 'kwargs': { 'INTERFACE': '*',
'PRIVATE': '*',
'PUBLIC': '*'},
'pargs': 0},
'LIBDIRS': { 'kwargs': { 'INTERFACE': '*',
'PRIVATE': '*',
'PUBLIC': '*'},
'pargs': '*'},
'PKGDEPS': '*',
'PROPERTIES': { 'kwargs': { 'EXPORT_NAME': 1,
'PROPERTIES': { 'kwargs': { 'ARCHIVE_OUTPUT_NAME': 1,
'EXPORT_NAME': 1,
'INTERFACE_INCLUDE_DIRECTORIES': 1,
'LIBRARY_OUTPUT_NAME': 1,
'OUTPUT_NAME': 1,
'SOVERSION': 1,
'SUFFIX': 1,
'VERSION': 1}},
'SRCS': '*'},
'pargs': '1+'},
Expand Down Expand Up @@ -58,15 +73,27 @@
'PY': '*',
'SHELL': '*'}},
'get_debs': {'pargs': [3, '*']},
'gtk_doc_add_module': { 'kwargs': { 'FIXREFOPTS': '*',
'IGNOREHEADERS': '*',
'LIBRARIES': '*',
'LIBRARY_DIRS': '*',
'SOURCE': '*',
'SUFFIXES': '*',
'XML': 1},
'pargs': 1},
'importvars': { 'kwargs': {'VARS': '+'},
'pargs': '1+',
'spelling': 'IMPORTVARS'},
'join': {'kwargs': {'GLUE': 1}, 'pargs': [1, '+']},
'pkg_find': {'kwargs': {'PKG': '*'}},
'stage_files': { 'kwargs': { 'FILES': '*',
'LIST': 1,
'SOURCEDIR': 1,
'STAGE': 1}}}

# Override configurations per-command where available
override_spec = {}

# Specify variable tags.
vartags = []

Expand All @@ -78,6 +105,9 @@
# -----------------------------
with section("format"):

# Disable formatting entirely, making cmake-format a no-op
disable = False

# How wide to allow formatted cmake files
line_width = 80

Expand Down
2 changes: 1 addition & 1 deletion bits/format-usage-short.txt
Expand Up @@ -26,7 +26,7 @@ optional arguments:
--dump-config [{yaml,json,python}]
If specified, print the default configuration to
stdout and exit
--dump {lex,parse,layout,markup}
--dump {lex,parse,parsedb,layout,markup}
--no-help When used with --dump-config, will omit helptext
comments in the output
--no-default When used with --dump-config, will omit any unmodified
Expand Down
4 changes: 3 additions & 1 deletion bits/format-usage.txt
Expand Up @@ -26,7 +26,7 @@ optional arguments:
--dump-config [{yaml,json,python}]
If specified, print the default configuration to
stdout and exit
--dump {lex,parse,layout,markup}
--dump {lex,parse,parsedb,layout,markup}
--no-help When used with --dump-config, will omit helptext
comments in the output
--no-default When used with --dump-config, will omit any unmodified
Expand All @@ -46,6 +46,8 @@ Options affecting listfile parsing:
Specify property tags.

Options affecting formatting.:
--disable [DISABLE] Disable formatting entirely, making cmake-format a no-
op
--line-width LINE_WIDTH
How wide to allow formatted cmake files
--tab-size TAB_SIZE How many spaces to tab for indent
Expand Down
2 changes: 2 additions & 0 deletions bits/lint-usage.txt
Expand Up @@ -35,6 +35,8 @@ Options affecting listfile parsing:
Specify property tags.

Options affecting formatting.:
--disable [DISABLE] Disable formatting entirely, making cmake-format a no-
op
--line-width LINE_WIDTH
How wide to allow formatted cmake files
--tab-size TAB_SIZE How many spaces to tab for indent
Expand Down
37 changes: 37 additions & 0 deletions changelog.rst
Expand Up @@ -2,10 +2,47 @@
Changelog
=========

.. default-role:: literal

-----------
v0.6 series
-----------

v0.6.11
-------

* Fix tag handling in release pipeline
* Fix positional specification removed from global configuration on first
parse of legacy commands
* Add argcomplete to frontend commands enabling bash completion
* Parse template listfiles that contain `@atword@` tokens at the statement
level (e.g. `@PACKAGE_INIT@`).
* Simplify path specification for `always_wrap` to omit `BodyNode`, and
number `PargGroupNode[#]`.
* Fix spelling configuration option not plumbed through to the formatter
* Add a config option to disable formatting (e.g. in a subdirectory)
* Add documentation for cmake-lint disable

* Closes: `#109`_: Formatting of files containing @VARIABLE@ fails
* Closes: `#177`_: vscode extension: add support for variable substitution ...
* Closes: `#179`_: Official docker image
* Closes: `#180`_: ... regarding `always_wrap`
* Closes: `#191`_: Inconsistent formatting for ...
* Closes: `#202`_: Spelling not accounted for
* Closes: `#207`_: Add DisableFormat option
* Closes: `#211`_: Add documentation for "cmake-lint:disable"

.. _#109: https://github.com/cheshirekow/cmake_format/issues/109
.. _#177: https://github.com/cheshirekow/cmake_format/issues/177
.. _#179: https://github.com/cheshirekow/cmake_format/issues/179
.. _#180: https://github.com/cheshirekow/cmake_format/issues/180
.. _#191: https://github.com/cheshirekow/cmake_format/issues/191
.. _#202: https://github.com/cheshirekow/cmake_format/issues/202
.. _#207: https://github.com/cheshirekow/cmake_format/issues/207
.. _#211: https://github.com/cheshirekow/cmake_format/issues/211

* Closes: f0fcbce

v0.6.10
-------

Expand Down
1 change: 1 addition & 0 deletions cmake-lint.rst
Expand Up @@ -10,6 +10,7 @@ common mistakes, and anti-patterns.
:maxdepth: 2

lint-usage
lint-inline
lint-example
lint-summary
lint-implemented
Expand Down
67 changes: 67 additions & 0 deletions configopts.rst
Expand Up @@ -45,6 +45,35 @@ config-file entry:
.. _override_spec:

override_spec
=============

Override configurations per-command where available

default value:
--------------

.. code::
{}
config-file entry:
------------------

.. code::
# ----------------------------------
# Options affecting listfile parsing
# ----------------------------------
with section("parse"):
# Override configurations per-command where available
override_spec = {}
.. _vartags:

vartags
Expand Down Expand Up @@ -165,6 +194,44 @@ config-file entry:
Options affecting formatting.
-----------------------------

.. _disable:

disable
=======

Disable formatting entirely, making cmake-format a no-op

default value:
--------------

.. code::
False
command-line option:
--------------------

.. code::
--disable [DISABLE] Disable formatting entirely, making cmake-format a no-
op
config-file entry:
------------------

.. code::
# -----------------------------
# Options affecting formatting.
# -----------------------------
with section("format"):
# Disable formatting entirely, making cmake-format a no-op
disable = False
.. _line_width:

line_width
Expand Down
14 changes: 12 additions & 2 deletions installation.rst
Expand Up @@ -44,7 +44,7 @@ Install from source
You can also install from source with pip. You can download a release package
from github__ or pypi__ and then install it directly with pip. For example::

pip install v0.6.10.tar.gz
pip install v0.6.11.tar.gz

.. __: https://github.com/cheshirekow/cmake_format/releases
.. __: https://pypi.org/project/cmake-format/#files
Expand Down Expand Up @@ -90,6 +90,16 @@ formatter, ``cmake-format``, to your hooks with the following addition to your
repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.10
rev: v0.6.11
hooks:
- id: cmake-format
Docker Images
=============

There is an official docker image at dockerhub__. You can pull the latest with,
e.g.::

docker pull cheshirekow/cmake-format

.. __: https://hub.docker.com/repository/docker/cheshirekow/cmake-format
40 changes: 40 additions & 0 deletions lint-inline.rst
@@ -0,0 +1,40 @@
=================
Inline Directives
=================

`cmake-lint` supports inline directives to help control local behavior. The
format of these directives is a cmake line comment with the following
format:

.. code::
# cmake-lint: <body>
-------
Pragmas
-------

disable
=======

You may specify a list of error codes to locally disable. You may specify
a comma separate list of codes to disable:

.. code::
# cmake-lint: disable=<code1>,<code2>,<code3>,...
Example:

.. code::
# cmake-lint: disable=C0103
foreach(LOOPVAR2 a b c d)
# pass
endforeach()
.. warning::

Currently this pragma must be specified at body scope (e.g. it cannot be a
comment within a statement) and it applies for the duration of the scope.
This behavior will likely change in the future.
23 changes: 23 additions & 0 deletions release_notes.rst
Expand Up @@ -2,12 +2,35 @@
Release Notes
=============

.. default-role:: literal

Details of changes can be found in the changelog, but this file will contain
some high level notes and highlights from each release.

v0.6 series
===========

-------
v0.6.11
-------

This release adds `argcomplete`__ handling to enable automatic shell
completion to `cmake-format` and `cmake-lint`. `argcomplete` is not an
installation dependency so if you wish to enable completion please install
`argcomplete` (e.g. via pip) and then activate it (see the documentation for
argcomplete).

.. __: https://pypi.org/project/argcomplete/

The visual studio code extension now supports variable substitution for things
like `${workspaceRoot}` and `${workspaceFolder}` in the `args` and `cwd`
configuration options.

There is a new configuration option to `disable` formatting. This can be
specified in a config file to conveniently no-op formatting within a
subdirectory (such as third-party source code) of a project.


-------
v0.6.10
-------
Expand Down
4 changes: 2 additions & 2 deletions rtd-requirements.txt
@@ -1,2 +1,2 @@
https://github.com/cheshirekow/cmake_format/releases/download/pseudo-master/cmake_format-0.6.10.dev3-py3-none-any.whl
PyYAML==5.3
https://github.com/cheshirekow/cmake_format/releases/download/pseudo-master/cmake_format-0.6.11.dev1-py3-none-any.whl
PyYAML=5.3
4 changes: 4 additions & 0 deletions sphinx-static/css/cheshire_theme.css
Expand Up @@ -89,6 +89,10 @@ h4 {

/* Change link colors (except for the menu) */

.wy-side-nav-search > a.icon-home {
color: #007eb9;
}

a {
color: #007eb9;
}
Expand Down

0 comments on commit a81eff1

Please sign in to comment.