-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix empty kwarg can yield a parg group node with only whitespace children * Fix ``file(READ ...)`` and ``file(STRINGS ...)`` parser kwargs using set syntax instead of dict syntax * Fix agressive positional parser within conditional parser * Fix missing endif, endwhile in parsemap * Split parse functions out into separate modules for better organization * Add more sanity tests for ``file(...)``. * Remove README from online docs, replace with expanded documentation for each README section * Restore ability to accept paren-group in arbitrary parg-group * Fix missing tests on travis * Fix new tests using unicode literals (affects python2) * Fix command parser after -- * Closes #104 - Extra space for export targets * Closes #106 - Formatting of ``file(READ)`` fails * Closes #107 - multiline cmake commands * Closes #108 - Formatting of ``file(STRING)`` fails * Closes #110 - Formatting of Nested Expressions Fails Change-Id: I1a4e0620dd42de613a3964b5d1af7caffeb6f54e
- Loading branch information
1 parent
0a8a97c
commit 28054df
Showing
42 changed files
with
3,612 additions
and
1,637 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,7 @@ | ||
additional_commands = { | ||
"pkg_find": { | ||
"kwargs": { | ||
"PKG": "*" | ||
} | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
autopep8==1.3.5; python_version < '3.0' | ||
autopep8==1.4.3; python_version >= '3.0' | ||
flake8==3.6.0; python_version < '3.0' | ||
flake8==3.7.7; python_version >= '3.0' | ||
jinja2==2.10.1 | ||
pylint==1.9.1; python_version < '3.0' | ||
pylint==2.2.2; python_version >= '3.0' | ||
pyyaml==4.2b1 |
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,10 @@ | ||
/.cmake-format.py | ||
/.gitignore | ||
/.flake8 | ||
/.pep8 | ||
/cmake/*.cmake | ||
/cmake_format | ||
/CMakeLists.txt | ||
/doc/conf.py | ||
/Makefile | ||
/pylintrc |
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 @@ | ||
dist: xenial | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.5" | ||
- "3.6" | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
|
||
script: | ||
- make test | ||
- make lint |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
""" | ||
from __future__ import unicode_literals | ||
|
||
VERSION = '0.5.0' | ||
VERSION = '0.5.1' |
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,53 @@ | ||
set(MODPREFIX cmake_format.command_tests) | ||
|
||
add_test(NAME cmake_format-add_custom_command_tests | ||
COMMAND python -m ${MODPREFIX}.add_custom_command_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-add_executable_tests | ||
COMMAND python -m ${MODPREFIX}.add_executable_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-add_library_tests | ||
COMMAND python -m ${MODPREFIX}.add_library_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-conditional_tests | ||
COMMAND python -m ${MODPREFIX}.conditional_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-export_tests | ||
COMMAND python -m ${MODPREFIX}.export_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-file_tests | ||
COMMAND python -m ${MODPREFIX}.file_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-install_tests | ||
COMMAND python -m ${MODPREFIX}.install_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-set_tests | ||
COMMAND python -m ${MODPREFIX}.set_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
|
||
if(NOT IS_TRAVIS_CI) | ||
add_test(NAME cmake_format-add_custom_command_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.add_custom_command_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-add_executable_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.add_executable_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-add_library_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.add_library_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-conditional_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.conditional_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-export_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.export_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-file_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.file_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-install_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.install_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
add_test(NAME cmake_format-set_tests_py3 | ||
COMMAND python3 -m ${MODPREFIX}.set_tests | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
endif() |
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
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 @@ | ||
# pylint: disable=bad-continuation | ||
from __future__ import unicode_literals | ||
import unittest | ||
|
||
from cmake_format.command_tests import TestBase | ||
|
||
|
||
class TestExportCommand(TestBase): | ||
""" | ||
Test various examples of export() | ||
""" | ||
|
||
def test_empty_parg_group(self): | ||
self.expect_format = """\ | ||
export(TARGETS FILE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake) | ||
""" | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Oops, something went wrong.