Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@
- name: Check code format
run: poetry run ruff format --diff .

mypy-check:
name: MyPy Check
ty-check:
name: Ty Check
runs-on: ubuntu-24.04
steps:
# Common steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.8.4"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Install dependencies
run: poetry install --all-extras

# Job-specific step(s):

- name: Run mypy
run: poetry run mypy --config-file mypy.ini airbyte_cdk
- name: Run ty
run: poetry run ty check airbyte_cdk

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 5 months ago

To fix the issue, we will add a permissions block at the root of the workflow file. This block will apply to all jobs in the workflow unless overridden by job-specific permissions blocks. Since the workflow only performs read-only operations (e.g., checking out code, installing dependencies, and running checks), we will set contents: read as the minimal required permission.


Suggested changeset 1
.github/workflows/python_lint.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml
--- a/.github/workflows/python_lint.yml
+++ b/.github/workflows/python_lint.yml
@@ -8,2 +8,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -8,2 +8,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
27 changes: 0 additions & 27 deletions mypy.ini

This file was deleted.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ dateparser = "^1.2.2"

[tool.poetry.group.dev.dependencies]
freezegun = "*"
mypy = "*"
ty = "*"
asyncio = "3.4.3"
ruff = "^0.11.5"
pdoc = "^15.0.0"
Expand Down Expand Up @@ -129,6 +129,9 @@ source-declarative-manifest = "airbyte_cdk.cli.source_declarative_manifest:run"

# Ruff configuration moved to ruff.toml

[tool.ty.src]
exclude = ["bin", "docs", "unit_tests"]

[tool.poe.tasks]
# Installation
install = { shell = "poetry install --all-extras", help = "Install all dependencies." }
Expand All @@ -154,7 +157,7 @@ _format-fix-prettier = {cmd = "npx prettier . --write", help = "Format with pret

# Linting/Typing check tasks
lint = {cmd = "poetry run ruff check .", help = "Lint with Ruff."}
type-check = {cmd = "poetry run mypy airbyte_cdk", help = "Type check modified files with mypy."}
type-check = {cmd = "poetry run ty check airbyte_cdk", help = "Type check with ty."}

# Linting/Typing fix tasks
lint-fix = { cmd = "poetry run ruff check --fix .", help = "Auto-fix any lint issues that Ruff can automatically resolve (excluding 'unsafe' fixes) with Ruff." }
Expand Down
Loading