Commit Graph

21 Commits

Author SHA1 Message Date
Stephen Finucane 57d1e9afc9 Project Migration to PyCQA
This change rehomes the project to PyCQA [1] as reported to the
openstack-dev mailing list [2].

[1] https://mail.python.org/pipermail/code-quality/2019-July/001112.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007878.html

Change-Id: I5472bea4994664495220ee4ab565f95666f21eee
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: I740c66cd959db1efa8ca8c9f29d4da4b66fbd993
2019-07-18 14:30:50 +01:00
Christian Berendt 5a4341727e Add check D005 - no newline at end of file
Change-Id: I160bb7e9b3c904655567caee999ac91366668109
2014-09-30 21:44:59 +02:00
Joshua Harlow 3912dca016 Allow a default_extension to be provided
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
2014-09-17 17:56:45 -07:00
Joshua Harlow beed9aa8b8 Ensure reading is done in one place only
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
2014-09-11 13:12:53 -07:00
Joshua Harlow 674cbbcd59 Cache the lines that are read instead of re-reading
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
2014-09-07 00:23:15 +00:00
Jenkins 392d4c9eaf Merge "Allow checks to provide a extension matcher" 2014-09-04 19:00:12 +00:00
Joshua Harlow 15ee57b572 Allow checks to provide a extension matcher
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
2014-09-03 15:19:21 -07:00
Joshua Harlow 73639a04db Correctly ignore parent directories when requested
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
2014-08-30 10:46:41 -07:00
Jenkins a0bab0082e Merge "Improve logging/printed output" 2014-08-27 04:43:54 +00:00
Joshua Harlow 687addf9b0 Detect the encoding using chardet
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
2014-08-22 22:04:36 -07:00
Joshua Harlow 0499ba81bd Improve logging/printed output
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
2014-08-16 18:31:03 -07:00
Jenkins 7e28ba6c44 Merge "Remove unneeded definitions of Python Source Code Encoding" 2014-08-13 02:55:03 +00:00
Christian Berendt c23864a0d1 Removed unused imports
Change-Id: I1feb733e266f76426237d8bb03dbbda21e3ea238
2014-08-01 14:19:01 +00:00
Christian Berendt c8e8a72623 Remove unneeded definitions of Python Source Code Encoding
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
2014-08-01 14:18:54 +00:00
Christian Berendt 72d30dae0a Make build environment workable
* 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>
2014-08-01 16:18:40 +02:00
Joshua Harlow 8b4a229d93 Use restructuredtext-lint instead of duplication
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
2014-06-25 10:39:55 -07:00
Joshua Harlow 83e9c42215 Add error linting to ensure that rst format is not invalid 2014-05-24 19:43:05 -07:00
Joshua Harlow 7d944e5783 Document dump settings (and default to off) 2014-05-18 18:34:06 -07:00
Joshua Harlow 3d1f5e4249 Delay assigning self._doc until after parsing succeeds 2014-05-18 18:29:55 -07:00
Joshua Harlow 6fb4ba286c Use the non-raw contents to ensure 3.3+ compat. 2014-05-18 18:28:52 -07:00
Joshua Harlow 930340b852 Add a parser module
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).
2014-05-18 17:26:42 -07:00