Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ggj][engx] fix: use imperative method names in Escapers #446

Merged
merged 32 commits into from
Oct 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
90c4f38
fix: support non-name fields with res-refs in resname def parsing
miraleung Oct 27, 2020
a74be70
fix: add workaround for missing default_host and oauth_scopes annotation
miraleung Oct 27, 2020
aef9843
Merge branch 'master' of github.com:googleapis/gapic-generator-java i…
miraleung Oct 29, 2020
fdb1ffb
fix: clarify LRO parsing error messages
miraleung Oct 27, 2020
642c606
feat: support deeply-nested types in AST and proto message parsing
miraleung Oct 28, 2020
3e26d87
fix: prevent resname tokens from matching subcomponents
miraleung Oct 28, 2020
837da38
fix: use TypeParser for proto message parsing
miraleung Oct 28, 2020
a5fc332
fix: use generic types in field instantiation in ServiceClientTest
miraleung Oct 28, 2020
b71b786
fix: prevent descension into map types in nested message parsing
miraleung Oct 29, 2020
602e1df
fix: merge master
miraleung Oct 29, 2020
07dddb8
fix: use both map generics in ServiceClientTest codegen
miraleung Oct 29, 2020
5e95e8f
fix: dir structure of generated files
miraleung Oct 29, 2020
c37c2d0
test: add asset API gradle pkg rules
miraleung Oct 29, 2020
8a7196f
fix: remove unused dep
miraleung Oct 29, 2020
f7f8099
test: add logging integration target and goldens, consolidate rules
miraleung Oct 29, 2020
9e0ad39
fix: merge master
miraleung Oct 29, 2020
9df3a5b
fix: fix asset_java_gapic build
miraleung Oct 30, 2020
96f8676
fix: fix test src packaging, update integration goldens
miraleung Oct 30, 2020
a91a085
fix: pass all tokens to instansiate in resname 1-pattern case
miraleung Oct 30, 2020
19e0a98
fix: update goldens
miraleung Oct 30, 2020
2dfd4b1
fix: update goldens
miraleung Oct 30, 2020
5dae221
build: add all integration tests to pre-commit hook
miraleung Oct 30, 2020
6917a2b
build: run pre-commit when goldens have changed
miraleung Oct 30, 2020
1aaf0a5
build: add integration golden tests to CircleCI
miraleung Oct 30, 2020
0ba9f53
fix: preserve newlines and parse itemized lists in protobuf comments
miraleung Oct 30, 2020
2b1b8d1
fix: remove extraneous escaper
miraleung Oct 30, 2020
c279667
Merge branch 'master' into alpha/g19
miraleung Oct 30, 2020
ceadd4e
Merge branch 'alpha/g19' of github.com:googleapis/gapic-generator-jav…
miraleung Oct 30, 2020
17893de
fix: update integration goldens for ServiceClient comment names
miraleung Oct 30, 2020
e75e828
fix: use serviceClient varname in ServiceClient codegen comments
miraleung Oct 30, 2020
3bf2ec4
fix: use imperative method names in Escapers
miraleung Oct 30, 2020
eff8904
Merge branch 'master' into alpha/g22
miraleung Oct 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ then
fi
fi

# Check integration tests.
if [ $NUM_JAVA_FILES_CHANGED -gt 0 ] \
|| [ $NUM_INTEGRATION_GOLDEN_FILES_CHANGED -gt 0 ] \
|| [ $NUM_INTEGRATION_BAZEL_FILES_CHANGED -gt 0 ]
then
echo_status "Checking integration tests..."
bazel --batch test --disk_cache="$BAZEL_CACHE_DIR" //test/integration/...
TEST_STATUS=$?
if [ $TEST_STATUS != 0 ]
then
echo_error "Tests failed." "Please fix them and try again."
exit 1
fi
fi

# Check and fix Bazel format.
if [ $NUM_BAZEL_FILES_CHANGED -gt 0 ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Builder addUnescapedComment(String comment) {
}

public Builder addComment(String comment) {
componentsList.add(HtmlEscaper.escaper(comment));
componentsList.add(HtmlEscaper.process(comment));
return this;
}

Expand All @@ -86,7 +86,7 @@ public Builder addSampleCode(String sampleCode) {
Arrays.stream(sampleCode.split("\\r?\\n"))
.forEach(
line -> {
componentsList.add(HtmlEscaper.escaper(line));
componentsList.add(HtmlEscaper.process(line));
});
componentsList.add("</code></pre>");
return this;
Expand Down Expand Up @@ -131,7 +131,7 @@ public JavaDocComment build() {
// Escape component in list one by one, because we will join the components by `\n`
// `\n` will be taken as escape character by the comment escaper.
componentsList =
componentsList.stream().map(c -> MetacharEscaper.escaper(c)).collect(Collectors.toList());
componentsList.stream().map(c -> MetacharEscaper.process(c)).collect(Collectors.toList());
setComment(String.join("\n", componentsList));
return autoBuild();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract static class Builder {
public abstract LineComment autoBuild();

public LineComment build() {
setComment(MetacharEscaper.escaper(comment()));
setComment(MetacharEscaper.process(comment()));
return autoBuild();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public String escape(String sourceString) {
return charEscaper.escape(sourceString);
}

public static String escaper(String source) {
public static String process(String source) {
return SINGLETON.escape(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String escape(String sourceString) {
return charEscaper.escape(sourceString);
}

public static String escaper(String source) {
public static String process(String source) {
return SINGLETON.escape(source);
}
}