Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
samples: add presubmit lint check (#156)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore(java_templates): add lint/static analysis presubmit checks for samples

* chore: fix trailing whitespace

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Mon Aug 17 14:29:16 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: c3caf0704f25a0c365f1c315e804a30b87c62a75
Source-Link: googleapis/synthtool@c3caf07

* chore(java_templates): stop running pmd/spotbugs checks for samples

This was creating too much noise. We will revisit with other options and/or tune these checks.

Source-Author: Jeff Ching <chingor@google.com>
Source-Date: Wed Aug 19 12:26:49 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 9602086c6c5b05db77950c7f7495a2a3868f3537
Source-Link: googleapis/synthtool@9602086

* chore: fix line length

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yoshi-automation and chingor13 committed Aug 27, 2020
1 parent f20b52a commit 34b5512
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/samples.yaml
@@ -0,0 +1,14 @@
on:
pull_request:
name: samples
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Run checkstyle
run: mvn -P lint --quiet --batch-mode checkstyle:check
working-directory: samples/snippets
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>9.0.0</version>
<version>9.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-document-ai</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</dependency>

```
Expand All @@ -50,11 +50,11 @@ If you are using Maven without BOM, add this to your dependencies:

If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-document-ai:0.2.2'
compile 'com.google.cloud:google-cloud-document-ai:0.2.1'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "0.2.2"
libraryDependencies += "com.google.cloud" % "google-cloud-document-ai" % "0.2.1"
```
[//]: # ({x-version-update-end})

Expand Down
Expand Up @@ -32,7 +32,8 @@ public static void parseWithModel() throws IOException {
// TODO(developer): Replace these variables before running the sample.
String projectId = "your-project-id";
String location = "your-project-location"; // Format is "us" or "eu".
// AutoML model name formatted as: "projects/[PROJECT_ID]/locations/[LOCATION]/models/[MODEL_ID]"
// AutoML model name formatted as:
// "projects/[PROJECT_ID]/locations/[LOCATION]/models/[MODEL_ID]"
String autoMlModel = "your-full-resource-model-name";
String gcsUri = "gs://your-gcs-bucket/path/to/input/file.json";
parseWithModel(projectId, location, autoMlModel, gcsUri);
Expand Down
5 changes: 3 additions & 2 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-document-ai.git",
"sha": "6375fc35ccbf5ce24062ba53720633fb63721e86"
"sha": "efa38a37599636742d80f75d0165f427fa7f3b33"
}
},
{
Expand All @@ -27,7 +27,7 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "f8823dec98277a9516f2fb6fae9f58b3a59a23e1"
"sha": "9602086c6c5b05db77950c7f7495a2a3868f3537"
}
}
],
Expand Down Expand Up @@ -60,6 +60,7 @@
".github/release-please.yml",
".github/trusted-contribution.yml",
".github/workflows/ci.yaml",
".github/workflows/samples.yaml",
".kokoro/build.bat",
".kokoro/build.sh",
".kokoro/coerce_logs.sh",
Expand Down

0 comments on commit 34b5512

Please sign in to comment.