When a file is found without an extension allow a CLI
provided default_extension to be used in these cases
so that files without extensions can be classified as
known file extension types.
Change-Id: I115ccc92ccd51a7018672b98b639ade30869f939
Instead of having reading being split across the lines_iter
method and the raw_content property just have it occur in
a common function so that it can be done once and only once.
Change-Id: I603bc4e85ad489d5397a78d6c987e15a0515f7ea
With-in the parsed file we cache the contents of the file
before it is converted to unicode and the contents of the
file after it is converted to unicode so it seems better to
follow this pattern and to also cache the raw lines (instead
of re-reading) as well.
Change-Id: Ic320a6c5517e513c88bdb4014d509a5791d85524
When a check is for a rst file vs a plaintext
file and is not interoperable this change allows
that check to declare that it only knows how to
scan certain files.
It also fixes the max line checker to use a similar
routine to differentiate between rst files and non
rst files and uses a different routine based on this
decision.
Change-Id: I1e3e5f9f1631ed5babe2df17c987e8e872938a38
Also does a ninja fix for undetectable decoding (by
assuming those files are utf-8 as a fallback, which
seems reasonable to do when chardet is unable to
figure out the encoding).
Fixes bug 1363191
Change-Id: I15c172f511a939b21c37f772eb17f78105acf648
Instead of always assuming utf-8 (which is typically
ok) switch to using the chardet library and use it to
detect the incoming files encoding in a more accurate
manner.
Change-Id: I907c8f4e1a6682138b220b49fcfcff6eef85a0b3
Add in a verbose mode that uses logging to output more
information when available. Also adjusts the output to
show which checks had which errors (which is useful to
know and is useful in general) as well as show the total
number of errors accumulated (and the specific break
downs).
Change-Id: Ia965aa7c7c3576230668217aa09cf61dc4ecd303
I think PEP 0263 (http://legacy.python.org/dev/peps/pep-0263/) is
not used anywhere else and so it should be removed when it's not
needed.
Change-Id: I013bf7f1df485d79b4cf17b874bfb22a0b920f2b
* Add files needed to build documentation. They are copied
from the cookiecutter repository.
* Replace setup.py and add setup.cfg
* Add tox.ini
* Add requirements.txt and test-requirements.txt
* Fix hacking issue H307 (like imports should be grouped together)
Change-Id: I325bb07233853611e8f0952a554a30dba2b7dfe7
Co-Authored-By: Joshua Harlow <harlowja@yahoo-inc.com>
Now that the restructuredtext-lint project has fixed
its code we can remove our temporary copy of the logic
that library was providing to catch errors and warning that
are emitted when the rst structure is invalid.
Change-Id: I2fadde86ff0b2c8fbb6c828535da19e097f1894e
This module contains a parse method and a parsed
file that provides attribute access to the needed
components of that file (used during checking for
doing various functionality).