Skip to content

Commit

Permalink
Add license header checking app (#404)
Browse files Browse the repository at this point in the history
* Add license header checking app

Almost the same config as the generative-ai-docs repo: https://github.com/google/generative-ai-docs/blob/main/.github/header-checker-lint.yml

* Add license headers to file-api samples.
  • Loading branch information
markmcd authored Jan 14, 2025
1 parent c044954 commit 5d28805
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Lint check for license headers.
# See: https://github.com/googleapis/repo-automation-bots/tree/main/packages/header-checker-lint
allowedCopyrightHolders:
- 'Google LLC'
allowedLicenses:
- 'Apache-2.0'
sourceFileExtensions:
- 'py'
- 'sh'
- 'ts'
- 'js'
- 'java'
# Note that separate nblint checks will handle *.ipynb files.
15 changes: 15 additions & 0 deletions quickstarts/file-api/sample.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const dotenv = require('dotenv');
const fs = require('fs');
const {google} = require('googleapis');
Expand Down
14 changes: 14 additions & 0 deletions quickstarts/file-api/sample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import google.generativeai as genai
import os
from dotenv import load_dotenv
Expand Down
13 changes: 13 additions & 0 deletions quickstarts/file-api/sample.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/bin/bash
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Upload a file using the GenAI File API via curl.
api_key=""
input_file=""
Expand Down

0 comments on commit 5d28805

Please sign in to comment.