This patch changes the regex to also match directives
which start with whitespace.
Closes-Bug: #1487302
Change-Id: I4c3168228164d865cc31dfd24160c41267aeb016
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
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
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
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
Instead of having a implicitly defined constant that doesn't
explain why the value was set use a documented frozenset that
has the valid docutils messaging levels with links/comments to
describe why they are being used.
Change-Id: I372c1babfb02c33b5881e2e6a12d464f75d944f7
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
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