Commit 0f5d7b0
[fix] put docs on separate line from block comment marker (#138)
<!-- PR title should start with '[fix]', '[improvement]' or '[break]' if this PR would cause a patch, minor or major SemVer bump. Omit the prefix if this PR doesn't warrant a standalone release. -->
## Before this PR
<!-- Describe the problem you encountered with the current state of the world (or link to an issue) and why it's important to fix now. -->
Conjure documentation strings that happened to begin or end with a quote symbol (`"`) would break block comment escaping and cause the interpreter to fail.
```yml
...
docs: These are the docs "this part is quoted"
...
```
renders in python as
```python
"""These are the docs "this part is quoted""""
```
and the interpreter says:
```python
SyntaxError: EOL while scanning string literal
```
## After this PR
<!-- Describe at a high-level why this approach is better. -->
By putting the docstring on a separate line from the block comment markers we avoid this conflict.
```python
"""
These are the docs "this part is quoted"
"""
```
<!-- Reference any existing GitHub issues, e.g. 'fixes #000' or 'relevant to #000' -->1 parent a7a8eb1 commit 0f5d7b0
File tree
4 files changed
+12
-4
lines changed- conjure-python-core/src
- main/java/com/palantir/conjure/python/poet
- test/resources
- services/expected/package_name/another
- types
- expected/package_name/another
4 files changed
+12
-4
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
0 commit comments