Skip to content

Commit

Permalink
ci: update linters configuration
Browse files Browse the repository at this point in the history
Update linters configuration to match style guides:

- CSS
- ESLint
- Markdownlint
- yamllint

bugs: 353152994

Change-Id: I9a25d179e675e432ca19771521d227a34e8f8e6b
GitOrigin-RevId: 84c672da6768906ff3c75a020d7379307cf96c3f
  • Loading branch information
ferrarimarco authored and Copybara committed Sep 17, 2024
1 parent 2606562 commit 6e674d8
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#

name: Deploy documentation to GitHub Pages
on:
on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
#
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
uses: actions/upload-pages-artifact@v3
if: github.ref == 'refs/heads/main'
with:
path: 'docs/build/public'
path: "docs/build/public"
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion projects/dataflow-gcs-to-alloydb/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Cloud Storage to AlloyDB or PostgreSQL server in Cloud SQL.
## Quickstart

1. [Configure](./configuration.md) the pipeline parameters.
2. [Build and run](./build_and_run_pipeline.md) the Dataflow Flex pipeline.
1. [Build and run](./build_and_run_pipeline.md) the Dataflow Flex pipeline.
4 changes: 2 additions & 2 deletions projects/dataproc-trino-autoscaler/docs/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ in this tutorial, you can delete the project:
1. In the Cloud Console, go to the
[**Manage resources** page](https://console.cloud.google.com/iam-admin/projects).
2. In the project list, select the project that you want to delete and then
1. In the project list, select the project that you want to delete and then
click **Delete**.
3. In the dialog, type the project ID and then click **Shut down** to delete
1. In the dialog, type the project ID and then click **Shut down** to delete
the project.
20 changes: 10 additions & 10 deletions projects/imagen-object-changer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ The solution works as follows:
1. The user provides an object label such as ‘car’, the source image file, and
a GenAI Imagen prompt such as ‘red plastic toy car’. In this case, to
replace cars with toy cars
2. Query Vision API with the source image and object label
3. Present list of found labels
4. If the user’s label was found in the list of detected labels, generate a
1. Query Vision API with the source image and object label
1. Present list of found labels
1. If the user’s label was found in the list of detected labels, generate a
mask image based on the bounding boxes for the objects
5. Query Imagen with the original image, mask image, and GenAI prompt
6. Save the resulting generated images
1. Query Imagen with the original image, mask image, and GenAI prompt
1. Save the resulting generated images

## Example

Expand Down Expand Up @@ -63,9 +63,9 @@ replace the background instead:
1. With your browser, navigate to the
[Google Cloud Console](https://console.cloud.google.com/home/dashboard) and
select the right Project
2. Use the Console to Enable the
1. Use the Console to Enable the
[Cloud Vision API in the API Library](https://console.cloud.google.com/apis/library/vision.googleapis.com)
3. Check that you can access
1. Check that you can access
[Generative AI Studio Vision](https://console.cloud.google.com/vertex-ai/generative/vision)

### Installing the Application
Expand All @@ -82,20 +82,20 @@ replace the background instead:
isolated environment for this application and its imported modules. Please
refer to the links in this step for more information on virtual environment

2. Open a terminal on your computer, and execute the following gcloud command
1. Open a terminal on your computer, and execute the following gcloud command
to authenticate the application for Google Cloud Platform:

```shell
gcloud auth application-default login
```

3. Install the Python dependencies with:
1. Install the Python dependencies with:

```shell
pip3 install -r requirements.txt --require-hashes
```

4. Test that the application can start without errors, by executing the
1. Test that the application can start without errors, by executing the
following:

```shell
Expand Down
40 changes: 20 additions & 20 deletions projects/imagen-voice-captioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ and [Text-to-Speech AI](https://cloud.google.com/text-to-speech).
The solution works as follows:

1. The user runs the application and selects a connected camera as the input
2. The applications shows a live view of the camera
3. The user triggers captioning
4. The camera’s image is sent to Imagen image captioning, which returns a
1. The applications shows a live view of the camera
1. The user triggers captioning
1. The camera’s image is sent to Imagen image captioning, which returns a
textual description of the scene
5. The text is sent to Text-to-Speech AI, which returns an audio file
1. The text is sent to Text-to-Speech AI, which returns an audio file
containing the caption synthesized as speech
6. The application plays back the audio, describing the scene verbally
1. The application plays back the audio, describing the scene verbally

## Example

Expand Down Expand Up @@ -46,11 +46,11 @@ in a grassy field behind a fence_”
1. With your browser, navigate to the
[Google Cloud Console](https://console.cloud.google.com/home/dashboard) and
select the right Project
2. Use the Console to Enable the
1. Use the Console to Enable the
[Cloud Vision Text to Speech API](https://console.cloud.google.com/apis/library/texttospeech.googleapis.com)
3. Use the Console to Enable the
1. Use the Console to Enable the
[Cloud Vision API in the API Library](https://console.cloud.google.com/apis/library/vision.googleapis.com)
4. Check that you can access
1. Check that you can access
[Generative AI Studio Vision](https://console.cloud.google.com/vertex-ai/generative/vision)

### Creating the Service Account and Key
Expand All @@ -59,8 +59,8 @@ in a grassy field behind a fence_”
to:

1. create a new service account in your GCP Project
2. create and download a JSON key for it
3. Bind the Cloud Storage object viewer role to it
1. create and download a JSON key for it
1. Bind the Cloud Storage object viewer role to it

This service account will be used to access Cloud Vision API. Execute the
following, replacing `[your-gcp-project]` with your project ID:
Expand All @@ -81,7 +81,7 @@ in a grassy field behind a fence_”
gcloud services enable vision.googleapis.com
```

2. The service account key was downloaded as a file called `credentials.json`
1. The service account key was downloaded as a file called `credentials.json`
in your current working directory. Note the location of the file, as you
will need it later.

Expand All @@ -101,20 +101,20 @@ in a grassy field behind a fence_”
isolated environment for this application and its imported modules. Please
refer to the links in this step for more information on virtual environment

2. Install the Python dependencies with:
1. Install the Python dependencies with:

```shell
pip3 install -r requirements.txt
```

3. Copy the service account key credentials.json that you downloaded earlier to
1. Copy the service account key credentials.json that you downloaded earlier to
this same directory with e.g:

```shell
cp ~/credentials.json .
```

4. Test that the application can start without errors, by executing the
1. Test that the application can start without errors, by executing the
following:

```shell
Expand All @@ -139,21 +139,21 @@ in a grassy field behind a fence_”

1. Connect a camera such as a USB webcam to your computer. Test that the camera
works on your computer
2. Start the application and provide the following parameter values:
1. Start the application and provide the following parameter values:

1. `--input`: <the device number of the connected cameras>. Start with 0
and increase the number until you see the correct camera’s output on the
screen
2. `--credentials`: <path to the credentials.json you prepared earlier>
3. `--project_id`: <your GCP project ID>
1. `--credentials`: <path to the credentials.json you prepared earlier>
1. `--project_id`: <your GCP project ID>

Example command:

```shell
python3 imagen-voice-captioning.py --input 1 --credentials credentials.json --project_id myproject
```

3. If successful, the application will output the following on the console:
1. If successful, the application will output the following on the console:

```text
{'input': '1', 'credentials': 'credentials.json', 'project_id': 'myproject''}
Expand All @@ -164,10 +164,10 @@ in a grassy field behind a fence_”
And open a window where it displays the camera’s live view on your desktop.
4. To caption the camera view, select the camera display window and press
1. To caption the camera view, select the camera display window and press
<SPACE>
5. If successful, the application will output:
1. If successful, the application will output:
```text
Querying Imagen captioning...OK
Expand Down
2 changes: 1 addition & 1 deletion projects/sa-tools/common/java-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This folder contains reusable Java components:
includeBuild("path/to/common/java-common")
```

2. Use appropriate module in your `build.gradle`: Example to use utils and
1. Use appropriate module in your `build.gradle`: Example to use utils and
testing module:

```groovy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { describe, expect, it } from 'vitest';
import {describe, expect, it} from 'vitest';
import * as common from './Common/CommonFunctions';

const commonFunctionsTestSuite = () => {
Expand Down
8 changes: 4 additions & 4 deletions projects/sa-tools/common/ui-tests/src/SaToolsDate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { describe, expect, it } from 'vitest';
import { SaToolsDate } from './Common/SaToolsDate';
import {describe, expect, it} from 'vitest';
import {SaToolsDate} from './Common/SaToolsDate';

const satoolsDateTestSuite = () => {
it(`Given N number of substracted minutes should return new Date object of
Expand All @@ -42,7 +42,7 @@ const satoolsDateTestSuite = () => {
ago`, () => {
const testDate = new SaToolsDate(new Date('2022-12-01 11:00:00'));
expect(testDate.formattedDateDiff(new Date('2022-12-01 10:00:00'))).toBe(
'1 hour(s) ago'
'1 hour(s) ago',
);
});

Expand Down Expand Up @@ -106,7 +106,7 @@ const satoolsDateTestSuite = () => {
it(`Given a datetime in 50 mins ago should return 50 minute(s) ago`, () => {
const testDate = new SaToolsDate(new Date('2022-12-01 10:10:00'));
expect(
testDate.formattedDateDiffFrom(new Date('2022-12-01 11:00:00'))
testDate.formattedDateDiffFrom(new Date('2022-12-01 11:00:00')),
).toBe('50 minute(s) ago');
});

Expand Down
4 changes: 2 additions & 2 deletions projects/sa-tools/common/ui-tests/src/StringSet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { describe, expect, it } from 'vitest';
import { StringSet } from './Common/StringSet';
import {describe, expect, it} from 'vitest';
import {StringSet} from './Common/StringSet';

/**
* Assert StringSet equality to an array.
Expand Down
2 changes: 1 addition & 1 deletion projects/sa-tools/common/ui-tests/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { defineConfig } from 'vite';
import {defineConfig} from 'vite';

export default defineConfig({
plugins: [],
Expand Down
2 changes: 1 addition & 1 deletion projects/sa-tools/common/ui/SaToolsDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ class SaToolsDate {
}
}

export { SaToolsDate };
export {SaToolsDate};
2 changes: 1 addition & 1 deletion projects/sa-tools/common/ui/StringSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ class StringSet {
}
}

export { StringSet };
export {StringSet};
16 changes: 8 additions & 8 deletions projects/sa-tools/perf-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Consists of 3 modules:
1. API Server: Java SpringBoot based server providing RESTful API for creating,
monitoring and cancelling BenchmarkJobs using the Benchmark Runner.

2. Benchmark Runner: Templated launch scripts on fork of Google's Perfkit
1. Benchmark Runner: Templated launch scripts on fork of Google's Perfkit
benchmark maintained by @prakhargautam at
<https://github.com/prakhag2/PerfKitBenchmarker> The runner executes a
parameterized Cloud Build jobs with job specific parameters passed as input
and writes the results to Google BigQuery table.

3. Daily Perfkit benchmarks runner cron-based runner for standard shapes.
1. Daily Perfkit benchmarks runner cron-based runner for standard shapes.

## Prerequisites

Expand Down Expand Up @@ -130,25 +130,25 @@ generated and open it in the browser:
gcloud firestore databases create --type=datastore-mode --project "${PROJECT_ID}" --location "nam5"
```
2. If facing this error: "Unable to Sign-In using Google Sign-In. An Error has
1. If facing this error: "Unable to Sign-In using Google Sign-In. An Error has
occured. Only accounts from the organization can access this site." Make
sure the Authorized Domains section under OAuth Screen
<https://console.cloud.google.com/apis/credentials/consent/edit?project=><replace_with_PROJECT_ID>
having domain name of user's Identiy Platform, ex: example.com Which means
<[email protected]> login will be allowed.

3. If facing this error: "Storage object. Permission 'storage.objects.get'
1. If facing this error: "Storage object. Permission 'storage.objects.get'
denied on resource (or it may not exist)., forbidden" or "denied: Permission
"artifactregistry.repositories.uploadArtifacts" denied on resource" Make
sure that <project_number>@cloudbuild.gserviceaccount.com exist, and having
Artifact Registry Writer and Storage Object Creator permissions.

4. If facing this error: "message":"Failed to open popup
1. If facing this error: "message":"Failed to open popup
window","stack":"Error: Failed to open popup window\n at new ..." Make sure
the allow pop-up from the Cloud Run's URL domain is allowed from Browser's
address bar.

5. Error: Members belonging to the external domain cannot be added as domain
1. Error: Members belonging to the external domain cannot be added as domain
restricted sharing is enforced by the organization policy Depending on
organization policy being used, some organization will have
constraints/iam.allowedPolicyMemberDomains to be restricted to be on the
Expand All @@ -165,13 +165,13 @@ generated and open it in the browser:
gcloud beta emulators datastore start --no-store-on-disk &
```

2. Set Environment variables
1. Set Environment variables

```shell
$(gcloud beta emulators datastore env-init)
```

3. Run Local server
1. Run Local server

```shell
cd api/
Expand Down
2 changes: 1 addition & 1 deletion projects/sa-tools/perf-benchmark/ui/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
/* eslint-disable comma-dangle, semi */
import { defineConfig } from 'vite';
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion projects/sa-tools/performance-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The deployment approach is by deploying two copies of pt-admin component:

1. To the target GCP Project. Create a new GCP Project, or use an existing GCP
Project where the deployer user having permissions as Owner or Editor.
2. To run pt-admin container locally (hosting the UI and part of the backend)
1. To run pt-admin container locally (hosting the UI and part of the backend)

The less pre-requisite dependencies to run this setup is by doing it from the
Cloud Shell. Make sure there's enough disk space to run the commands below.
Expand Down
6 changes: 3 additions & 3 deletions projects/sa-tools/performance-testing/pt-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ cluster-info` shows).
kubectl apply -f config/samples/
```

2. Build and push your image to the location specified by `IMG`:
1. Build and push your image to the location specified by `IMG`:

```sh
make docker-build docker-push IMG=<some-registry>/pt-operator:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:
1. Deploy the controller to the cluster with the image specified by `IMG`:

```sh
make deploy IMG=<some-registry>/pt-operator:tag
Expand Down Expand Up @@ -68,7 +68,7 @@ the desired state is reached on the cluster.
make install
```

2. Run your controller (this will run in the foreground, so switch to a new
1. Run your controller (this will run in the foreground, so switch to a new
terminal if you want to leave it running):

```sh
Expand Down
Loading

0 comments on commit 6e674d8

Please sign in to comment.