summaryrefslogtreecommitdiff
path: root/tools/custom_guidelines.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove six and python 2.7 full supportHervé Beraud2020-04-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Six is in use to help us to keep support for python 2.7. Since the ussuri cycle we decide to remove the python 2.7 support so we can go ahead and also remove six usage from the python code. Review process and help ----------------------- Removing six introduce a lot of changes and an huge amount of modified files To simplify reviews we decided to split changes into several patches to avoid painful reviews and avoid mistakes. To review this patch you can use the six documentation [1] to obtain help and understand choices. Additional informations ----------------------- Changes related to 'six.b(data)' [2] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ six.b [2] encode the given datas in latin-1 in python3 so I did the same things in this patch. Latin-1 is equal to iso-8859-1 [3]. This encoding is the default encoding [4] of certain descriptive HTTP headers. I suggest to keep latin-1 for the moment and to move to another encoding in a follow-up patch if needed to move to most powerful encoding (utf8). HTML4 support utf8 charset and utf8 is the default charset for HTML5 [5]. Note that this commit message is autogenerated and not necesserly contains changes related to 'six.b' [1] https://six.readthedocs.io/ [2] https://six.readthedocs.io/#six.b [3] https://docs.python.org/3/library/codecs.html#standard-encodings [4] https://www.w3schools.com/charsets/ref_html_8859.asp [5] https://www.w3schools.com/html/html_charset.asp Patch 28 of a serie of 28 patches six fully removed now! Thank you six for the rendered services! Change-Id: If44ee4b565cc9390fa0422fba4dda080b4f90b98
* pep8: Permit ".)" at the end of resource docsZane Bitter2019-10-141-2/+3
| | | | | | | | | | When a sentence is wholly contained within parentheses, the period at the end should appear inside the closing parenthesis. The current pep8 check requires that e.g. resource property descriptions must end with a period, which makes things awkward when the last sentence is parenthesised. Allow them to optionally end with ".)" instead. Change-Id: I489c424136047e57e4649739fd0b0727bc3cc915
* Use correct raw string formatZane Bitter2017-11-161-9/+9
| | | | | | | | You're not supposed to just randomly put backslashes in front of other characters that don't need escaping unless it's a raw string. This is deprecated in Python 3.6. Change-Id: I7a69ba6dd10412bb065f2b6ba405840d0a98663a
* Merge "Check all resources with custom guidelines"Jenkins2017-04-031-15/+34
|\
| * Check all resources with custom guidelinesPeter Razumovsky2017-03-221-15/+34
| | | | | | | | | | | | | | | | | | | | | | If resource has available_resource_mapping method and it's not available, custom guidelines check will skip it, which is incorrect. This patch improves list of resources: now only hidden, contrib and manually excluded resources don't checked. Change-Id: Ic2cb37fb3fe4aefb8b3efb911aecf46155541469 Closes-bug: #1674949
* | Remove log translationsliyi2017-03-251-3/+2
|/ | | | | | | | | | | | Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: Ieec8028305099422e1b0f8fc84bc90c9ca6c694f
* Don't raise error in custom guidelines on IOErrorPeter Razumovsky2016-08-241-2/+10
| | | | | | | | | | | In some merge issues files or modules can be removed, but still registered in global env. In that cases custom guidelines raises an error with the message "No such file or directory". Add exception handling to avoid error raising. Instead of error, call warning and skip such class. Change-Id: I71af2fffc2bdec414cb68c40eaf3268fe81134de Closes-bug: #1613669
* Refactor confusing code in custom_guidelines.pyZane Bitter2016-05-091-5/+5
| | | | Change-Id: Iae7efbb8fe4157301deebd0776139489832f470f
* Exclude plugins from custom_guidelines.pySteve Baker2016-05-091-0/+3
| | | | | | | This is broken by our plugin package magic, so lets exclude the plugin package from this tool. Change-Id: I2da474b706cdb33e98675edabb0f607106c816d0
* Ignore template res types during guideline checksSergey Kraynev2016-03-021-0/+3
| | | | | | | | | | | | | | | | | | | | | Global environment during registering resources also load resources from /etc/environment.d . As result it loads two resources mapped on templates: - 'AWS::CloudWatch::Alarm' - 'AWS::RDS::DBInstance' However execute guideline checks for these resources is not possible due to these resources use template_resource object and can not be processed as usual *.py file. This patch add ignoring for these two resource types. Note: this error is not displayed on pep8 gate job due to we don't install devstack during execution this job, but this error affects all environments with installed devstack. Closes-Bug: #1552194 Change-Id: I29abdfa1a4f4a17dfbcdaaf6f0c6665359bab17a
* Fix all trailing spaces for custom guidelinesPeter Razumovsky2016-02-261-1/+1
| | | | | | | | | | There are several trailing spaces error raised by custom guidelines check. Need to fix them for successful pep8 running. implements bp custom-guidelines Change-Id: Ibf50208155315e75795d7b9c8a8dbe487f9046ac
* Fix all method errors for custom guidelinesPeter Razumovsky2016-02-261-1/+1
| | | | | | | | | | There are several method error raised during custom guidelines check. Need to fix it for successful running pep8. implements bp custom-guidelines Change-Id: I55883bb8d314f982161aaa21c010e9d1467bf903
* Fix resources descriptions for custom guidelinesPeter Razumovsky2016-02-261-1/+1
| | | | | | | | | There're several errors, raised by custom guidelines check, need to fix it for successful pep8 running. implements bp custom-guidelines Change-Id: Ibef41cad9b20715a740cedac7b98e9647bd3d6b7
* Fix all attributes error for custom guidelinesPeter Razumovsky2016-02-261-2/+2
| | | | | | | | | | There are several errors during attributes descriptions checking by custom guidelines. Need to fix them for successful pep8 running. implements bp custom-guidelines Change-Id: I3df75c6343217723fd4490f9e70eb2d8499eb5ae
* Fix all properties errors for custom guidelinesPeter Razumovsky2016-02-261-6/+3
| | | | | | | | | | There are several errors, raised during properties schemas checking by custom guidelines. Need to fix them for successful pep8 running. implements bp custom-guidelines Change-Id: Icd24498b8d36106412a61d4b82b00eb92095ffe9
* Implement custom guidelinesPeter Razumovsky2016-02-191-0/+274
Implement custom guidelines for next cases: * resources descriptions * properties schemas descriptions * attributes schemas descriptions * methods descriptions * trailing spaces in attributes and properties descriptions Also, enable custom guidelines check in pep8 checking. implements bp custom-guidelines Change-Id: Ic7b1061abfb42880c476602edb45bc40da291eb0