-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pylint and docstring checks for promptflow-evals PRs (#3547)
# Description This PR - Fixes all existing pylint errors in promptflow-evals - Adds docstrings to all public promptflow-evals methods and classes - Adds a pylint gate to run on all PRs that make changes to the promptflow-evals module # All Promptflow Contribution checklist: - [x] **The pull request does not introduce [breaking changes].** - [x] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [x] **I confirm that all new dependencies are compatible with the MIT license.** - [] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [] Pull request includes test coverage for the included changes.
- Loading branch information
1 parent
2b53d9b
commit fda05ab
Showing
66 changed files
with
1,265 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Pylint | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- src/promptflow-evals/** | ||
|
||
jobs: | ||
run_pylint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- uses: snok/install-poetry@v1 | ||
- name: install pylint and azure-pylint-guidelines-checker | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: | | ||
set -xe | ||
poetry install -C src/promptflow-evals --with dev | ||
poetry show -C src/promptflow-evals | ||
- name: run pylint | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: | | ||
cd src/promptflow-evals | ||
poetry run pylint promptflow/evals --rcfile=../../pylintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[MASTER] | ||
py-version=3.9 | ||
ignore-patterns=test_*,conftest,setup,.*_utils\.py | ||
ignore-paths=src\promptflow-evals\tests,src\promptflow-evals\samples,promptflow\evals\evaluate\_telemetry,promptflow\evals\evaluate\_batch_run_client\code_client.py,promptflow\evals\evaluate\_batch_run_client\proxy_client.py | ||
reports=no | ||
load-plugins=pylint_guidelines_checker | ||
|
||
[MESSAGES CONTROL] | ||
# For all codes, run 'pylint --list-msgs' or go to 'https://pylint.pycqa.org/en/latest/technical_reference/features.html' | ||
# locally-disabled: Warning locally suppressed using disable-msg | ||
# cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 | ||
# too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. | ||
# Let's black deal with bad-continuation | ||
|
||
# Added disables from super-with-arguments | ||
disable=useless-object-inheritance,missing-timeout,missing-client-constructor-parameter-kwargs,logging-fstring-interpolation,locally-disabled,fixme,cyclic-import,unnecessary-lambda-assignment,client-method-missing-type-annotations,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,client-paging-methods-use-list,docstring-keyword-should-match-keyword-only,docstring-type-do-not-use-class,client-accepts-api-version-keyword,networking-import-outside-azure-core-transport,protected-access,missing-module-docstring,missing-client-constructor-parameter-credential | ||
|
||
[FORMAT] | ||
max-line-length=120 | ||
|
||
[VARIABLES] | ||
# Tells whether we should check for unused import in __init__ files. | ||
init-import=yes | ||
|
||
[DESIGN] | ||
# Maximum number of locals for function / method body | ||
max-locals=25 | ||
# Maximum number of branch for function / method body | ||
max-branches=20 | ||
# Maximum number of instance attributes for class | ||
max-attributes=10 | ||
# Maximum number of ancestors | ||
max-parents=15 | ||
|
||
[SIMILARITIES] | ||
min-similarity-lines=10 | ||
|
||
[BASIC] | ||
# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). | ||
# Consider these guidelines and not hard rules. Read PEP 8 for more details. | ||
|
||
# The invalid-name checker must be **enabled** for these hints to be used. | ||
include-naming-hint=yes | ||
|
||
module-naming-style=snake_case | ||
const-naming-style=UPPER_CASE | ||
class-naming-style=PascalCase | ||
class-attribute-naming-style=snake_case | ||
attr-naming-style=snake_case | ||
method-naming-style=snake_case | ||
function-naming-style=snake_case | ||
argument-naming-style=snake_case | ||
variable-naming-style=snake_case | ||
inlinevar-naming-style=snake_case | ||
|
||
[TYPECHECK] | ||
generated-members=js.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.