It seems to be common practice to lowercase these instead
of uppercasing the first word so let's just follow that
practice.
Change-Id: I2c8620257cd9f0566e1d7e1ec88461f18f0bcef4
Instead of only ignoring full files or ignoring full
codes for all files, allow for ignoring specific errors
for certain files.
Change-Id: I0ebfbe1d2dc68990c84bc0b47d872e44e19b5b2a
When sphinx (and by association restructuredtext-lint)
finds an error with say a anonymous backref it does not
include the line number (it defaults to none); so in this
case covert that line number to ? and output that as the
line number in the output shown to the user.
Change-Id: I013857cdb6a24cf11d94265358b8294dfed0236d
The option shouldn't be named 'ignore_path' but should be
named 'ignore-path' to match the docs and to match the CLI
argument.
Change-Id: If5346910b259a0c092eea5c9adde281c2f2ff347
Chardet doesn't always seem to correctly detect files encoding
correctly in all circumstances, to make it so that a user can
specify the exact encoding of there files allow a new config
option and a new CLI option that allows for manually overriding
the encoding that chardet will try to determine.
If enabled chardet detection will no longer run.
Fixes bug 1384463
Change-Id: Ie8baf3f79083e1495c7420a9d0569390cad2115e
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
Now that these are functions we don't need to
destroy the incoming configuration dictionary
by popping things from it.
Change-Id: I5d0ff032f0e7c9e79d39c3f5d533c43801502a8c
Have there be a scanning function that contained the
previous file scanning logic, then a validating function
that did the checking logic and then have the main function
call into those functions instead of containing all the
same logic in its own function.
Change-Id: Ie35665a016164122be294fee41e7ce54605d832e
Capitalize help strings and end with "." to follow best practice from
other tools. Also improve some strings.
Change-Id: I7005f4a187385096d6a9c1e5cb1322ba76048a1c
Instead of always printing that the check was skipped when in non
verbose mode, log/print it only when verbose mode is enabled and not
otherwise.
Change-Id: I0190b9d82568fb18871591d64ec6bd4695751367
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
Instead of mixing print and logging usage in the main
program just instead use print directly, this still
configures logging incase we use a library which has
useful output that verbose mode should display.
Change-Id: I38e77ba53e72d68e612d77d4b2c9b6af465d385c
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
When a check has only a subset of its
codes requested to be ignored we need
to make sure when we run that check that
we still skip the codes that were requested
to be ignored (and let the ones that were
not requested passthrough).
Change-Id: I05f419a8d99fa0cd9cea50e264e2a4c4a64376bd
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
When doc8 scans rst files with sphinx specific roles
and references it is unable to determine what those roles
are and then complains that these false positives are
actual errors.
To avoid these types of false positives add a option that
can be provided when running on files that may contain these
types of errors to allow them to be skipped/ignored.
Change-Id: Ia6896617534f68e517d5996d53cf2de274507f56
Also update the option parser to set the metavar
for the new ignore-path argument to 'path' (instead of
the default of 'IGNORE_PATH' which the option parser
generates automatically).
Change-Id: I13c845c13f4b80511dc4d5b179ba80030e8b9972
If the path is a file the file will not be checked for style
issues.
If the path is a directory all files inside this directory or
subdirectories will not be checked for style issues.
Change-Id: Ic40f798fb65804844e545de72263c44a8a603a40
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
Avoid keeping all the files that have been read and scanned
in memory by use a deque and popping files off after they
have been read (this allows the gc to clean them up).