Skip to content

Commit

Permalink
Add Lint Workflow (#123)
Browse files Browse the repository at this point in the history
### Motivation and Context
This PR adds a Lint Github workflow so that code style rules can be
enforced for PRs.

1. This forms a baseline workflow that can be used as a template for
future workflows that will be added.
2. It helps enforce code style rules. Currently it only checks
PyCodeStyle and PyFlakes. Others will be added in the future.
3. Contributes to automated testing
4. Does not fix any open issue.

### Description
Added Ruff as a dev dependency. Added Github workflow which runs Ruff.

---------

Co-authored-by: Aditya Gudimella <adgudime@microsoft.com>
Co-authored-by: Devis Lucato <dluc@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 24, 2023
1 parent b636d9d commit 79d24c1
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint
on: push
# concurrency:
# group: lint-${{ github.ref }}
# cancel-in-progress: true

jobs:
ruff:
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "/root/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
cache-dependency-path: "python/pyproject.toml"
- name: Install SemanticKernel
run: cd python && poetry install --no-ansi
- name: Run lint
run: cd python && poetry run ruff check .
black:
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- run: echo "/root/.local/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
cache-dependency-path: "python/pyproject.toml"
- name: Install SemanticKernel
run: cd python && poetry install --no-ansi
- name: Run lint
run: cd python && poetry run black --check .
31 changes: 29 additions & 2 deletions python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pre-commit = "^2.21.0"
black = {version = "^23.1.0", allow-prereleases = true}
ipykernel = "^6.21.1"
pytest = "7.2.0"
ruff = "^0.0.257"

[tool.isort]
profile = "black"
Expand Down
1 change: 0 additions & 1 deletion python/semantic_kernel/core_skills/text_memory_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class TextMemorySkill:

COLLECTION_PARAM = "collection"
RELEVANCE_PARAM = "relevance"
KEY_PARAM = "key"
Expand Down

0 comments on commit 79d24c1

Please sign in to comment.