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

Added linters and pre-commit hooks #36

Open
wants to merge 2 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
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [-b, main, -b, master]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-pyproject]
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ releases.

With the possible exception of major releases, all contributions must
maintain the existing API's syntax and semantics.

15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.black]
target-version = ["py37", "py38", "py39", "py310", "py311"]
line-length = 120
skip-magic-trailing-comma = true

[tool.flake8]
max-line-length = 120
ignore = ["E203", "E266", "E501", "W503"]
exclude = [".git", "__pycache__", "venv"]
per-file-ignores = ["*/__init__.py: F401"]

[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ coverage
python-dateutil >= 2.4.0
setuptools
wheel
pre-commit
black
61 changes: 28 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,32 @@
- http://vobject.skyhouseconsulting.com/history.html
"""

from setuptools import setup, find_packages

doclines = (__doc__ or '').splitlines()

setup(name = "vobject",
version = "0.9.7",
author = "Jeffrey Harris",
author_email = "jeffrey@osafoundation.org",
maintainer = "David Arnold",
maintainer_email="davida@pobox.com",
license = "Apache",
zip_safe = True,
url = "http://py-vobject.github.io/vobject/",
download_url = 'https://github.com/py-vobject/vobject/tarball/0.9.7',
bugtrack_url = "https://github.com/py-vobject/vobject/issues",
entry_points = {
'console_scripts': [
'ics_diff = vobject.ics_diff:main',
'change_tz = vobject.change_tz:main'
]
},
include_package_data = True,
install_requires = ['python-dateutil >= 2.4.0', 'six'],
platforms = ["any"],
packages = find_packages(),
description = "A full-featured Python package for parsing and creating "
"iCalendar and vCard files",
long_description = "\n".join(doclines[2:]),
keywords = ['vobject', 'icalendar', 'vcard', 'ics', 'vcs', 'hcalendar'],
test_suite="tests",
classifiers = """
from setuptools import find_packages, setup

doclines = (__doc__ or "").splitlines()

setup(
name="vobject",
version="0.9.7",
author="Jeffrey Harris",
author_email="jeffrey@osafoundation.org",
maintainer="David Arnold",
maintainer_email="davida@pobox.com",
license="Apache",
zip_safe=True,
url="http://py-vobject.github.io/vobject/",
download_url="https://github.com/py-vobject/vobject/tarball/0.9.7",
bugtrack_url="https://github.com/py-vobject/vobject/issues",
entry_points={"console_scripts": ["ics_diff = vobject.ics_diff:main", "change_tz = vobject.change_tz:main"]},
include_package_data=True,
install_requires=["python-dateutil >= 2.4.0", "six"],
platforms=["any"],
packages=find_packages(),
description="A full-featured Python package for parsing and creating " "iCalendar and vCard files",
long_description="\n".join(doclines[2:]),
keywords=["vobject", "icalendar", "vcard", "ics", "vcs", "hcalendar"],
test_suite="tests",
classifiers="""
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
Expand All @@ -63,5 +58,5 @@
Programming Language :: Python
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Topic :: Text Processing""".strip().splitlines()
)
Topic :: Text Processing""".strip().splitlines(),
)
2 changes: 1 addition & 1 deletion test_files/ms_tzid.ics
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ BEGIN:VEVENT
UID:CommaTest
DTSTART;TZID="Canberra, Melbourne, Sydney":20080530T150000
END:VEVENT
END:VCALENDAR
END:VCALENDAR
2 changes: 1 addition & 1 deletion test_files/ruby_rrule.ics
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SUMMARY:Something
DTSTART:20030101T070000
DTSTAMP:20080529T152100
END:VEVENT
END:VCALENDAR
END:VCALENDAR
Loading