Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.05 KB

CONTRIBUTING.md

File metadata and controls

56 lines (45 loc) · 2.05 KB

✨ Contributing to Linty Fresh ✨

Code of Conduct

This project is governed by Lyft's code of conduct. All contributors and participants agree to abide by its terms.

CLA

In order to clarify the intellectual property rights in the project, and to grant licenses to the project to others, we require contributors accept the CLA. Don't worry, we don't need anything faxed in, just a PR from you. Follow the instructions at https://oss.lyft.com/cla and you'll be good to contribute.

Python 3.5

Linty Fresh is currently written to target Python 3.5, partly as a way to experiment with Type Hints and async/await. When possible, use asynchronous libraries like aiohttp or asyncio. Where appropriate, add type hints. Unfortunately mypy, the type checker for PEP 0484 types, doesn't support parsing async/await code yet (see python/mypy#913) so we can't integrate types into CI, but PyCharm is able to parse/validate types.

Running Tests

python3 setup.py test
python3 setup.py flake8

Implementing a New Linter

Implementing a new linter is fairly straight forward. Under the linters directory, add a new python file with the name of the linter you want to support. This file should implement a function parse with the signature:

def parse(contents: str) -> Set[Problem]:

It should take the contents of a lint file and return a set of Problems for each problem parsed in that file.

Then, add an entry in the LINTERS map in main.py for your new linter module. You should now ne able to specify this linter as one of the linters on the command line.

Before submitting a PR, please add unit tests.