Skip to content
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

Add separate line lenght for RST and add back Python 2.7. #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:

linux:
py3:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Scame on itself
run: |
scame --align-closing --max-length=200 --pycodestyle scame/ setup.py
scame --align-closing --max-length=200 --pycodestyle scame/ setup.py release-notes.rst

- name: pyflakes
run: |
Expand All @@ -58,3 +58,36 @@ jobs:
- name: Black
run: |
black --check scame/ setup.py

py27:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 15
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Show action context
run: |
echo << EOF
${{ toJSON(github) }}
EOF

- uses: actions/checkout@v2

- name: Set Up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7

- name: Install
run: |
pip install .[dev]

- name: Unit test
run: |
nosetests scame/

- name: Scame on itself
run: |
scame --align-closing --max-length=200 --pycodestyle scame/ setup.py release-notes.rst

20 changes: 20 additions & 0 deletions release-notes.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
scame-0.7.2 - 2022-04-02
========================

* Fix source checker on py3.


scame-0.7.1 - 2022-03-24
========================

* Fix error reporting for binary files.


scame-0.7.0 - 2022-03-24
========================

* Add back support for Python 2.7
* Add line length configuration for RST checker.


scame-0.6.3 - 2021-06-01
========================

* Fix git diff parsing.


scame-0.6.2 - 2021-06-01
========================

Expand Down
2 changes: 1 addition & 1 deletion scame/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Helper to run various static checks.
"""
__version__ = "0.6.3"
__version__ = "0.7.2"
9 changes: 8 additions & 1 deletion scame/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import subprocess
import sys
import six
from optparse import OptionParser

from scame import __version__
Expand Down Expand Up @@ -114,11 +115,17 @@ def parse_command_line(args):

def _get_all_files(dir_path):
"""
Generated all the files in the dir_path tree (recursive),
Generated all the files in the dir_path tree (recursive).

It accepts unicode input and generated unicode output.
"""
if six.PY2 and os.name == 'posix':
dir_path = dir_path.encode('utf-8')
for root, _, filenames in os.walk(dir_path):
for name in filenames:
target = os.path.join(root, name)
if isinstance(target, six.binary_type):
target = target.decode('utf-8')
yield target


Expand Down
Loading