Skip to content

Commit

Permalink
add example project
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Dec 10, 2018
1 parent b74c072 commit 5019ed2
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ No config file found, using default configuration
Your code has been rated at 10.00/10 (previous run: 2.50/10, +7.50)
```

### Example Package
An example package is found in the [`example/`](example) directory.

```
➜ pylint --load-plugins pylint_quotes example
************* Module foo.__init__
example/foo/__init__.py:3:0: C4001: Invalid string quote ", should be ' (invalid-string-quote)
************* Module foo
example/foo/__init__.py:1:0: C0102: Black listed name "foo" (blacklisted-name)
************* Module foo.other
example/foo/other.py:1:0: C4003: Invalid docstring quote ''', should be """ (invalid-docstring-quote)
example/foo/other.py:4:0: R0903: Too few public methods (1/2) (too-few-public-methods)
example/foo/other.py:10:0: C4002: Invalid triple quote """, should be ''' (invalid-triple-quote)
************* Module foo.utils
example/foo/utils.py:15:0: C4001: Invalid string quote ", should be ' (invalid-string-quote)
example/foo/utils.py:5:0: C4003: Invalid docstring quote ''', should be """ (invalid-docstring-quote)
example/foo/utils.py:10:0: C4003: Invalid docstring quote ''', should be """ (invalid-docstring-quote)
------------------------------------------------------------------
Your code has been rated at 1.11/10 (previous run: 1.11/10, +0.00)
```


## Installation

Installing with `pip`:
Expand Down
8 changes: 8 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Example
This directory contains an example python package, named `foo`. Various
string formatting inconsistencies exist to showcase how `pylint-quotes`
behaves.

```
pylint --load-plugins pylint_quotes .
```
4 changes: 4 additions & 0 deletions example/foo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Example package foo."""

__title__ = "foo"
__version__ = '1.2.3'
13 changes: 13 additions & 0 deletions example/foo/other.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'''Other file in the example.'''


class Other:
"""Does one thing or another."""

@classmethod
def help(cls):
"""Returns a help string."""
return """
Help:
This is an example class; it does nothing.
"""
15 changes: 15 additions & 0 deletions example/foo/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Utilities for the example project."""


def do_something():
'''Does something.'''
return 'something'


def do_something_else():
'''Does something else.
Returns:
str: A string of some sort.
'''
return "string1 " + 'string2'
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ deps=
twine>=1.5.0
commands=
python setup.py sdist bdist_wheel
twine upload dist/*
twine upload dist/*

[testenv:example]
description=
run pylint with pylint-quotes on the example
commands=
pylint --load-plugins pylint_quotes example

0 comments on commit 5019ed2

Please sign in to comment.