opensearch-project / demos

Apache License 2.0
2 stars 13 forks source link

Adds pyproject.toml for YAPF linter #104

Closed yash1506 closed 10 months ago

yash1506 commented 10 months ago

Description

This change adds configuration settings for the YAPF linter in a new pyproject.toml file stored at the root of the repo. YAPF (Yet Another Python Formatter) is an open-source Python linter that automatically reformats code based on the style standard chosen in the config settings and also allows for more customization, such as changing the indent space size. Currently, the pyproject.toml configuration adopts the PEP 8 style guide, ensuring codebase consistency and readability. It customizes formatting with a 2-space indentation, a 100-character line limit, and specific style settings for brackets and dictionaries, enhancing structure and visual clarity.

Issues Resolved

Aims to reolve #94

PS. Black was not chosen as it doesnt support 2 space indents. PyLint and Flake8 were not chosen as they are just style checkers and don't automatically format code for you. YAPF seemed to be the better option out of all of them.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.