-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pylint] alias checker and tests #23471
Merged
Merged
Conversation
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
l0lawrence
commented
Mar 15, 2022
l0lawrence
changed the base branch from
feature_alias_pylint
to
feature/pylint-plugins
March 15, 2022 23:05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Left some questions and comments.
catalinaperalta
approved these changes
Mar 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
l0lawrence
added a commit
that referenced
this pull request
Apr 19, 2022
* [pylint] alias checker and tests (#23471) * intro patch for aliasing - needs better way to grab __all__ info * updated alias message * line number shows up with alias warning * working on testing this, slight mod to isinstance * tests for aliasing * updated docstring * removing random import * adding in a newline * adding in a newline * changing naming of error message * changing package to model in except * checking for only __all__ assign Node (cat) * added alias checker to README * added test file to test disable pylint warning * add from import test * removed unused imports * changing test names for clarity * added newline * added link from Izzy * fixed some issues with the links * fixed some issues with the links2 * fix for running core on pylint pr * removed cr * checking ignore files * seeing if ignore file will fix core breaks * fix path in ci * removed ignore * removed ignore file * rerun * removing core * made 2 for loops to figure out why search is not catching in core run * core * remvoing core * renaming to naming_mismatch * fix message name * fixing naming issues * naming init * naming register * changing name to align with checker name change * fixed messaging * fixing pylint error * found a less invasive way to get to the model name in __all__ * reverting back to originally bc init can have more than 1 assign * [pylint] Api checker (#23500) * setting remote * setting up api version checker * api checker * running core to see where error pops up * trying to get tests to run * python versioning and kwargs will change this * checking docstring for api version keyword * added basic test for docstring api_version * adding in a test file for api version checker * edit test file * removing import that got added * added newline: * remvoing scripts from pipeline * added newline: * added in check for init doc too * added in a test for init having the doc versus the init * had to make tests go down to the class level to run test files * fixing naming schema and docs for api checker - renamed error * instead of splitting the doc - directly check for the keyword api_version string * renaming file to match other test files * switching around the order of keyword and param to see the effect on the checker * renaming changed file name in test * added api checker to the readme * refactoring - if class doc has api_verison, skip looking at the init func * fixing docstring on bad test * changing credential type in test docstring * adding in endpoint as an arg in the init * addind endpoint as arg in init * adding endpoint as arg * updating test file names to follow acceptable and violation format * updating file names in tests, and updating test function names to follow violation and acceptable trend * fixing eof newline errors * trying to get commits into pr * eof newline * changing class name to APIVersion instead of api * init file, also updated APIVersion name * adding end colon to api_verion str checking * added in end colon to node.doc check too * [pylint] adding in correct links for pylint (#23503) * adding in correct links for pylint * added in better links * updating links * updating links * add in url to tests * add in url to tests * fixed disable in README for client-method-should-not-use-static-method * fixing merge issue in readme with api_checker * Enum cases (#23571) * setting upstream * start of enum checker * wip enum cehcker * passing basic test, need to only check enum * adding tests for enum * removed print statements * tests * added in check that class is Enum related * adding rule for caseInsensitiveMeta * had to change how to check for Enum b/c Meta makes it a Call Node * added in a test for CaseInsensitive * random import * added to readme * changed regsistered name * fixed checker for uppercase so it references correct line * fixed test to reflect line change in checker * removing excess == * add new line * seeing where enum checker will fail * rerun * remove alias * removing alias for ci * added in consideration for python3 meta syntax * fixed error assuming metaclass exists * adding enum class check * missing an init * removing the alias from readme * fix docstring for enum class * removing core * enum checker update comments * editing comments on checker * refactoring for 2 diff syntaxes: * added test file for enum * removed _CaseInsensitiveEnumMeta * some syntax changing * fixing comments * list is superfluous: * removing the import that was default added for Node * fixing space in comment, and removing if arg.name - pr comments * edited test files, to test for both errors being thrown in the same enum class - pr comments * fixing naming of test methods for readability * split the enum checker into 2 private functions for the 2 different rules * making if into elif on 1783 and 1800 to prevent breaking when python2 enum format * renaming test files -pr comments * python3 enum inherit class checker now uses _metaclass versus declared_metaclass() * added in test for python 3 metaclass format * enum_code now uses helper functions to return a boolean for both pylint guidelines * adding a test to verify metaclass syntax ensures the MetaClass is the 1st argument arg[0] * removing unused test files * renaming test names to follow _violation and _acceptable pattern * fixing inheritance of enummeta class format * added in docstrings for the helper functions created * adding newline at eof * removing spaces from the eof line for github error * clarifying enum_class helper function docstring * fixing docstring edits * returning booleans versus returning the individual variable * collapsing inherit helper function to call message directly instead * adding newline to eof * updating _check_is_enum_class docstring return, rtype * adding in import statement for metaclass, and enum to tests * had to import with_metaclass for py2 * had to also import with_metaclass for python2 tests * using declared_metaclass() instead of metaclass to get the metaclass for both py2 and py3 syntax * removing uneeded for loop and now we are directly checking enum within the bases (arguments) of the class node * collapsing a helper method to simplify logic of checker * fixing indentation of tests * adding space in api version error * updating the broken links in the pylint warnings to match the README (#23726) * [pylint] Updating PylintCheckers testing (#23707) * Updating CheckNamingMismatchGeneratedCode testing - naming convention and adding guidelines link test * Updating CheckEnum test suite - added test for readme guideline links * CheckAPIVersion added test for guidelines link * FileHasCopyrightHeader added in test files to test for copyright header checker * created TestPackageNameDoesNotUseUnderscoreOrPeriod * TestPackageNameDoesNotUseUnderscoreOrPeriod adding guidelines link test * added in TestServiceClientUsesNameWithClientSuffix test class * fixed newline issues at end of file * added guidelines link into NamingMismatchGeneratedCode warning: * fixed PR comments with helper function for guidelines - import requests * [pylint] Suppressing pylint for ACR, Tables and AppConfig (#24002) * suppressing ACR pylint * suppress tables pylint * [pylint] suppressing app config pylint (#24007) * suppressing ACR pylint * suppress tables pylint * app config suppressions * app config, pulling changes that merged * [formrecognizer] Fix pylint errors in enums (#24012) * add case insensitive enum meta * fix import order * [pylint] fixing enum checker (#24068) * fixing enum checker * extra space fix :( * fixing enum pylint issue (#24050) * fixing pylint issues for now (#24057) * [Servicebus] Fixing pylint issues (#24049) * fixing service bus pylint issues * removing extra line * same extra line * pr comments: int Enums don't need to inherit * if if doesn't have str - no metaclass * disabling pylint checker for now (#24056) * fix pylint issues (#24051) * fixing pylint issues (#24054) * fixing pylint issues for now (#24055) * adding eventgrid fixes, resetting to feature branch (#24046) * [Monitor] pylint issues fixed (#24053) * fixing monitor query pylint issues * extra line * [pylint] Fix remoterender (#24074) * fix remoterender * adding line * remove line Co-authored-by: catalinaperalta <catalinaperaltah@hotmail.com>
azure-sdk
pushed a commit
to azure-sdk/azure-sdk-for-python
that referenced
this pull request
Apr 13, 2023
Review request for Microsoft.ContainerInstance to add version stable/2023-05-01 (Azure#23485) * Adds base for updating Microsoft.ContainerInstance from version preview/2022-10-01-preview to version 2023-05-01 * Updates readme * Updates API version in new specs and examples * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23166) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23169) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23170) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23452) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * use old api versionf or operations * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23453) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * use old api versionf or operations * revert Operations example api version * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23471) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * use old api versionf or operations * revert Operations example api version * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23473) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * MGRP S360 Vuln (Azure#22832) * Add blockchain to latest profile * Add additional types * Fix Swagger issues * Solve validation --------- Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> * use old api versionf or operations * Azure Orbital - swagger fix for api-version 2022-11-01 (Azure#23441) * added example for the new field * updated the double ref that was causing build failure * Fixed PrometheusRuleGroups examples (Azure#23390) * Fixed PrometheusRuleGroups examples * One more fix * Remvoe flattern (Azure#23460) Co-authored-by: Will Huang <huangwill@microsoft.com> * Mvad update (Azure#23434) * Add default value 10 for topContributorCount * Update AnomalyDetector typespec to latest typespec and Azure.Core versions and fix all warnings * Update TypeSpec config * Add back language emitter options * Fix cspell and model validation errors --------- Co-authored-by: Chunlei Wang <chuwan@microsoft.com> * revert Operations example api version --------- Co-authored-by: ramoka178 <57157576+ramoka178@users.noreply.github.com> Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> Co-authored-by: Stuti Kumar <113545470+stuti-1807@users.noreply.github.com> Co-authored-by: giladsu <43436811+giladsu@users.noreply.github.com> Co-authored-by: will <koyasu221b@gmail.com> Co-authored-by: Will Huang <huangwill@microsoft.com> Co-authored-by: Mike Kistler <mikekistler@microsoft.com> Co-authored-by: Chunlei Wang <chuwan@microsoft.com> * use management.auzre.com endpoint * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23483) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * MGRP S360 Vuln (Azure#22832) * Add blockchain to latest profile * Add additional types * Fix Swagger issues * Solve validation --------- Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> * use old api versionf or operations * Azure Orbital - swagger fix for api-version 2022-11-01 (Azure#23441) * added example for the new field * updated the double ref that was causing build failure * Fixed PrometheusRuleGroups examples (Azure#23390) * Fixed PrometheusRuleGroups examples * One more fix * Remvoe flattern (Azure#23460) Co-authored-by: Will Huang <huangwill@microsoft.com> * Mvad update (Azure#23434) * Add default value 10 for topContributorCount * Update AnomalyDetector typespec to latest typespec and Azure.Core versions and fix all warnings * Update TypeSpec config * Add back language emitter options * Fix cspell and model validation errors --------- Co-authored-by: Chunlei Wang <chuwan@microsoft.com> * revert Operations example api version * use management.auzre.com endpoint --------- Co-authored-by: ramoka178 <57157576+ramoka178@users.noreply.github.com> Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> Co-authored-by: Stuti Kumar <113545470+stuti-1807@users.noreply.github.com> Co-authored-by: giladsu <43436811+giladsu@users.noreply.github.com> Co-authored-by: will <koyasu221b@gmail.com> Co-authored-by: Will Huang <huangwill@microsoft.com> Co-authored-by: Mike Kistler <mikekistler@microsoft.com> Co-authored-by: Chunlei Wang <chuwan@microsoft.com> * fix package version in readme * Fnuarnav containerinstance microsoft.container instance 2023 05 01 (Azure#23484) * add container security context property * update readme tag to previous stable version * add example with security context * avocado fix default tag should contain all endpoints * add back spot priority changes * use previous stable version as default tag * prettier fix * use spaces * fix error * use spaces * fix CI errors * use altest api version as default for Avocado * update host to eastus2euap endpoint to check manifest * MGRP S360 Vuln (Azure#22832) * Add blockchain to latest profile * Add additional types * Fix Swagger issues * Solve validation --------- Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> * use old api versionf or operations * Azure Orbital - swagger fix for api-version 2022-11-01 (Azure#23441) * added example for the new field * updated the double ref that was causing build failure * Fixed PrometheusRuleGroups examples (Azure#23390) * Fixed PrometheusRuleGroups examples * One more fix * Remvoe flattern (Azure#23460) Co-authored-by: Will Huang <huangwill@microsoft.com> * Mvad update (Azure#23434) * Add default value 10 for topContributorCount * Update AnomalyDetector typespec to latest typespec and Azure.Core versions and fix all warnings * Update TypeSpec config * Add back language emitter options * Fix cspell and model validation errors --------- Co-authored-by: Chunlei Wang <chuwan@microsoft.com> * revert Operations example api version * add codeowners for Compute Instance swagger (Azure#23437) Co-authored-by: Naman Agarwal <naagarw@microsoft.com> * [Hub Generated] Review request for Microsoft.DevHub to add version preview/2022-10-11-preview (Azure#22828) * Adds base for updating Microsoft.DevHub from version preview/2022-04-01-preview to version 2022-10-11-preview * Updates readme * Updates API version in new specs and examples * start 10-11 preview * add words * fix readme version * update swagger version * add second putworkflow example * fix generatepreviewartifactsresponse * align generate preview artifacts example * update param locations that got changed * add x-ms-client-flatten for artifact properties * Adding WorkflowRunStatus * Fixing enum name * add namespace to example --------- Co-authored-by: Brandon Foley <brandonfoley13@gmail.com> * Update readme.python.md (Azure#23208) * fixing async response type for machinelearningservices-2023-02-01-preview (Azure#23105) * fixing regex pattern and async response type * remove update to regex * Fix lint error for Datadog RP (Azure#23477) * Fix link error for Datadog RP * Fix version * merging billing fix to public repo (Azure#23424) Co-authored-by: Gaurav Bang <gauravbang@microsoft.com> * use management.auzre.com endpoint * fix package version in readme --------- Co-authored-by: ramoka178 <57157576+ramoka178@users.noreply.github.com> Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> Co-authored-by: Stuti Kumar <113545470+stuti-1807@users.noreply.github.com> Co-authored-by: giladsu <43436811+giladsu@users.noreply.github.com> Co-authored-by: will <koyasu221b@gmail.com> Co-authored-by: Will Huang <huangwill@microsoft.com> Co-authored-by: Mike Kistler <mikekistler@microsoft.com> Co-authored-by: Chunlei Wang <chuwan@microsoft.com> Co-authored-by: Naman Agarwal <namanag16@gmail.com> Co-authored-by: Naman Agarwal <naagarw@microsoft.com> Co-authored-by: David Gamero <david340804@gmail.com> Co-authored-by: Brandon Foley <brandonfoley13@gmail.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Karishma Daga <karishmadaga@microsoft.com> Co-authored-by: vikotha <81368129+vikotha@users.noreply.github.com> Co-authored-by: Gaurav <bang.gourav@gmail.com> Co-authored-by: Gaurav Bang <gauravbang@microsoft.com> * fix tag in readme * update example with capabilities example * fix typo --------- Co-authored-by: ramoka178 <57157576+ramoka178@users.noreply.github.com> Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com> Co-authored-by: Stuti Kumar <113545470+stuti-1807@users.noreply.github.com> Co-authored-by: giladsu <43436811+giladsu@users.noreply.github.com> Co-authored-by: will <koyasu221b@gmail.com> Co-authored-by: Will Huang <huangwill@microsoft.com> Co-authored-by: Mike Kistler <mikekistler@microsoft.com> Co-authored-by: Chunlei Wang <chuwan@microsoft.com> Co-authored-by: Naman Agarwal <namanag16@gmail.com> Co-authored-by: Naman Agarwal <naagarw@microsoft.com> Co-authored-by: David Gamero <david340804@gmail.com> Co-authored-by: Brandon Foley <brandonfoley13@gmail.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com> Co-authored-by: Karishma Daga <karishmadaga@microsoft.com> Co-authored-by: vikotha <81368129+vikotha@users.noreply.github.com> Co-authored-by: Gaurav <bang.gourav@gmail.com> Co-authored-by: Gaurav Bang <gauravbang@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will affect MetricsAdvisor and KeyVault Secrets and Search
Some changes to README links, other PR will fix link errors