Skip to content

Commit

Permalink
Revert change that introduced regression, fixes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankSpruce committed Jul 10, 2024
1 parent b99f442 commit 6a5e6ff
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## [0.13.6] 2024-07-10
### Fixed
- non-deterministic formatting regression (#32)

## [0.13.5] 2024-06-29
### Fixed
- improve consistency of `add_executable`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You can use gersemi with a pre-commit hook by adding the following to `.pre-comm
```yaml
repos:
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.13.5
rev: 0.13.6
hooks:
- id: gersemi
```
Expand Down
2 changes: 1 addition & 1 deletion gersemi/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__license__ = "MPL 2.0"
__title__ = "gersemi"
__url__ = "https://github.com/BlankSpruce/gersemi"
__version__ = "0.13.5"
__version__ = "0.13.6"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Impl(old_class):
options = get("options")
one_value_keywords = get("one_value_keywords")
multi_value_keywords = get("multi_value_keywords")
sections = signature.get("sections", {})
sections = get("sections")

return Impl

Expand Down
14 changes: 14 additions & 0 deletions gersemi/command_invocation_dumpers/project_command_dumpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class Export(
"PACKAGE": dict(one_value_keywords=["PACKAGE"]),
"SETUP": dict(
one_value_keywords=["SETUP"],
multi_value_keywords=["PACKAGE_DEPENDENCY", "TARGET"],
sections=dict(
PACKAGE_DEPENDENCY=dict(
front_positional_arguments=["<dep>"],
Expand Down Expand Up @@ -285,6 +286,7 @@ class Install(
"TARGETS",
_INCLUDES_DESTINATION,
"RUNTIME_DEPENDENCIES",
*_Install_TARGETS_kinds,
],
),
"FILES": dict(
Expand Down Expand Up @@ -315,6 +317,7 @@ class Install(
"FILE_PERMISSIONS",
"DIRECTORY_PERMISSIONS",
"CONFIGURATIONS",
*_Install_DIRECTORY_kinds,
],
),
"SCRIPT": dict(
Expand Down Expand Up @@ -363,6 +366,7 @@ class Install(
one_value_keywords=["RUNTIME_DEPENDENCY_SET"],
multi_value_keywords=[
"IMPORTED_RUNTIME_ARTIFACTS",
*_Install_IMPORTED_RUNTIME_ARTIFACTS_kinds,
],
),
"RUNTIME_DEPENDENCY_SET": dict(
Expand Down Expand Up @@ -391,6 +395,7 @@ class Install(
"POST_INCLUDE_FILES",
"POST_EXCLUDE_FILES",
"DIRECTORIES",
*_Install_RUNTIME_DEPENDENCY_SET_kinds,
],
),
}
Expand Down Expand Up @@ -459,6 +464,14 @@ class TargetLinkLibraries(
SectionAwareCommandInvocationDumper, ArgumentAwareCommandInvocationDumper
):
front_positional_arguments = ["<target>"]
multi_value_keywords = [
"INTERFACE",
"PUBLIC",
"PRIVATE",
"LINK_PRIVATE",
"LINK_PUBLIC",
"LINK_INTERFACE_LIBRARIES",
]
sections = {
"INTERFACE": _debug_optimized_general,
"PUBLIC": _debug_optimized_general,
Expand All @@ -483,6 +496,7 @@ class TargetPrecompileHeaders(ArgumentAwareCommandInvocationDumper):

class TargetSources(SectionAwareCommandInvocationDumper):
front_positional_arguments = ["<target>"]
multi_value_keywords = ["INTERFACE", "PUBLIC", "PRIVATE"]
sections = {
"INTERFACE": {
"one_value_keywords": ["FILE_SET", "TYPE"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def _split_multi_value_argument(self, tree):
return Tree("section", subarguments)

def _split_arguments(self, arguments):
self.multi_value_keywords.extend(self.sections.keys())
preprocessed = super()._split_arguments(arguments)
return [
(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### {list_expansion: favour-expansion}
set(list_containing_keyword
PUBLIC
pthread )

target_link_libraries(unrelated PRIVATE pthread)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(list_containing_keyword
PUBLIC
pthread
)

target_link_libraries(unrelated PRIVATE pthread)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### {list_expansion: favour-expansion}
target_link_libraries(unrelated PRIVATE pthread)

set(list_containing_keyword
PUBLIC
pthread )
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target_link_libraries(unrelated PRIVATE pthread)

set(list_containing_keyword
PUBLIC
pthread
)

0 comments on commit 6a5e6ff

Please sign in to comment.