From 111304e81614ef55ec198e3708c7f8f5aabe83f8 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: May 04 2018 15:49:12 +0000 Subject: Add man page, ignore spelling warnings Signed-off-by: Christian Heimes --- diff --git a/black.1 b/black.1 new file mode 100644 index 0000000..ffc6675 --- /dev/null +++ b/black.1 @@ -0,0 +1,27 @@ +.TH "BLACK" "1" "04-May-2018" "black Manual" +.SH NAME +black \- The uncompromising code formatter. +.SH SYNOPSIS +.B black +[OPTIONS] [SRC]... +.SH DESCRIPTION +The uncompromising code formatter. +.SH OPTIONS +.TP +\fB\-l,\fP \-\-line\-length INTEGER +How many character per line to allow. [default: 88] +.TP +\fB\-\-check\fP +Don't write the files back, just return the status. Return code 0 means nothing would change. Return code 1 means some files would be reformatted. Return code 123 means there was an internal error. +.TP +\fB\-\-diff\fP +Don't write the files back, just output a diff for each file on stdout. +.TP +\fB\-\-fast\fP / \-\-safe +If --fast given, skip temporary sanity checks. [default: --safe] +.TP +\fB\-q,\fP \-\-quiet +Don't emit non-error messages to stderr. Errors are still emitted, silence those with 2>/dev/null. +.TP +\fB\-\-version\fP +Show the version and exit. diff --git a/python-black.rpmlintrc b/python-black.rpmlintrc new file mode 100644 index 0000000..6f624d0 --- /dev/null +++ b/python-black.rpmlintrc @@ -0,0 +1,3 @@ +addFilter('spelling-error.*formatter') +addFilter('spelling-error.*pycodestyle') +addFilter('no-manual-page-for-binary black-3*') diff --git a/python-black.spec b/python-black.spec index 5f216f7..f635705 100644 --- a/python-black.spec +++ b/python-black.spec @@ -9,6 +9,7 @@ Summary: The uncompromising code formatter License: MIT URL: https://github.com/ambv/black Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Source1: black.1 BuildArch: noarch BuildRequires: python3-devel @@ -53,11 +54,13 @@ cp %{buildroot}/%{_bindir}/black %{buildroot}/%{_bindir}/black-%{python3_version # Remove shebang for pyfile in %{buildroot}%{python3_sitelib}/blib2to3/pgen2/token.py %{buildroot}%{python3_sitelib}/%{pypi_name}.py; do - sed '1{\@^#!/usr/bin/env python@d}' ${pyfile} > ${pyfile}.new && + sed '1{\@^#!\s*/usr/bin/env python@d}' ${pyfile} > ${pyfile}.new && touch -r ${pyfile} ${pyfile}.new && mv ${pyfile}.new ${pyfile} done +install -D -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/black.1 + %check %{__python3} setup.py test @@ -67,6 +70,7 @@ done %{_bindir}/black # {_bindir}/black-3 %{_bindir}/black-%{python3_version} +%{_mandir}/man1/black.1* %{python3_sitelib}/__pycache__/* %{python3_sitelib}/%{pypi_name}.py