-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from freedomofpress/add-flake8-black
Add flake8, black, isort; GitHub action
- Loading branch information
Showing
8 changed files
with
105 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: | | ||
apt-get update && apt-get install --yes --no-install-recommends make python3-pip | ||
pip install black==23.7.0 flake8==6.0.0 isort==5.12.0 | ||
- name: Run lint | ||
run: | | ||
make lint-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: flake8 isort isort-fix black black-fix lint-all | ||
|
||
# Directory to run the linters on | ||
DIR = . | ||
|
||
flake8: | ||
@echo "Running Flake8" | ||
@flake8 $(DIR) | ||
|
||
isort: | ||
@echo "Running isort" | ||
@isort --check --diff $(DIR) | ||
|
||
isort-fix: | ||
@echo "Running isort (fix)" | ||
@isort $(DIR) | ||
|
||
black: | ||
@echo "Running Black" | ||
@black --check $(DIR) | ||
|
||
black-fix: | ||
@echo "Running Black (fix)" | ||
@black $(DIR) | ||
|
||
lint-all: flake8 isort black | ||
@echo "Linting complete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[tool.black] | ||
line-length = 100 | ||
target-version = ['py39'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools import find_packages, setup | ||
|
||
with open('requirements.txt') as f: | ||
with open("requirements.txt") as f: | ||
reqs = f.read().split() | ||
|
||
with open('README.md') as f: | ||
with open("README.md") as f: | ||
readme = f.read() | ||
|
||
setup( | ||
name='trackthenews', | ||
version='0.2', | ||
description='Monitor RSS feeds for keywords and act on matching results. A special project of the Freedom of the Press Foundation.', | ||
name="trackthenews", | ||
version="0.2", | ||
description="Monitor RSS feeds for keywords and act on matching results." | ||
" A special project of the Freedom of the Press Foundation.", | ||
long_description=readme, | ||
long_description_content_type='text/markdown', | ||
long_description_content_type="text/markdown", | ||
install_requires=reqs, | ||
author='Parker Higgins', | ||
author_email='[email protected]', | ||
url='https://github.com/freedomofpress/trackthenews', | ||
entry_points={ | ||
'console_scripts': ['trackthenews=trackthenews:main'] | ||
}, | ||
package_data={ | ||
'trackthenews': ['fonts/*'] | ||
}, | ||
author="Parker Higgins", | ||
author_email="[email protected]", | ||
url="https://github.com/freedomofpress/trackthenews", | ||
entry_points={"console_scripts": ["trackthenews=trackthenews:main"]}, | ||
package_data={"trackthenews": ["fonts/*"]}, | ||
include_package_data=True, | ||
license='MIT', | ||
license="MIT", | ||
classifiers=[ | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.9'], | ||
packages=find_packages(exclude=('ttnconfig',)) | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
], | ||
packages=find_packages(exclude=("ttnconfig",)), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .core import * | ||
from .core import main # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters