Commit Graph

30 Commits (06631795c0a7de0f7b45c8c5dabc796b4cd86bcc)

Author SHA1 Message Date
Manuel Kaufmann b774e081d7 Regex string escape properly 2018-11-28 14:33:00 +01:00
Eric Holscher 183b176920 Revert "Merge pull request #4636 from rtfd/search_upgrade" (#4716)
This reverts commit 182ab8d491, reversing
changes made to 6261427e66.
2018-10-03 11:51:34 -06:00
Safwan Rahman cb069239a6 fixing the indexing 2018-09-15 07:26:49 +06:00
Safwan Rahman 143ce7fede Optimizing reindexing management command 2018-07-27 20:49:31 +06:00
Safwan Rahman b9dbb5d1a3 fixing docstring 2018-07-17 05:01:59 +06:00
Safwan Rahman 8fc3b65fd0 [Fix #4333] Implement asynchronous search reindex functionality using celery 2018-07-17 04:42:34 +06:00
Safwan Rahman d30bac3608 fixing python3 compatibility 2018-07-16 09:20:52 +06:00
Safwan Rahman a82f006e30 more fixup 2018-07-16 09:20:51 +06:00
Safwan Rahman ccf23829d6 fixup and adding test 2018-07-16 09:20:51 +06:00
Safwan Rahman e8ac7691f1 [fix #4265] Port Document search API for Elasticsearch 6.x 2018-07-16 09:20:50 +06:00
Santos Gallegos d6e2f7d3be Noqa 2018-05-25 13:45:15 -05:00
Manuel Kaufmann 5cb3ba6b7b Organize logging levels (#3893)
* Organize logging levels

Log only what we need as ERROR when it's something that we need/want
to take a look that something could be a bug/issue.

There are some ERROR that were replaced by WARNING since they are some
failures but that we don't need to take a look and the message shown
to the user should be enough for them.

* Fix lint issues

* Use the proper exc_info instead of custom formatting
2018-04-05 16:57:30 -06:00
Manuel Kaufmann bbb980f4c3 Disable false positive for raising StopIteration 2018-01-25 19:59:41 -05:00
Manuel Kaufmann 4d10f2e287 Fix D213 using docformatter
prospector \
  --profile-path=/home/humitos/rtfd/code/readthedocs.org \
  --profile=prospector --die-on-tool-error \
  | \
  grep -e "^[a-z] \
  > \
  list-files.txt

for x in `cat list-files.txt`; do \
  docformatter \
    --wrap-summaries=80 \
    --wrap-descriptions=80 \
    --pre-summary-newline \
    --no-blank \
    --in-place readthedocs/$x\
; done
2017-12-15 20:18:06 -05:00
Eric Holscher 547cfb0045 Clean up logging around exceptions 2017-11-08 12:48:14 -07:00
Eric Holscher 7a3b8a8766 Remove unreasonably search indexing output 2017-11-07 13:38:24 -07:00
Anthony accc01535c Finish linting on py3ish code (#2949)
* Resolve first round of linting errors in restapi.

This is a first step and only adds docstrings, etc. It doesn't refactor any
code.

Conflicts:
	prospector-more.yml
	readthedocs/restapi/views/model_views.py

* Reduce unused params.

In several cases, we can use the provided `request` rather than access `self`
(which could make these functions easier to test in isolation). In others, the
unused args could be folded into an unnamed kwarg param.

* Don't replace section variable.

This worked as intended, but only because the overridden section variable
would later evaluate to True. Using a different variable name makes this a bit
less error-prone.

* Minor docstring update

* Fix indent on docstring

* Punt on refactoring

* Fix call args

* Try unpinning testing reqs

* Bump up prospector higher level strictness

* Linting issues: arguments-differ, len-as-condition, redefined variables

* Remove unnecessary elses

This addresses no-else-return, which removes a `return` in an `else` after an
`if` that already has a `return`. This makes the default return more obvious in
most cases.

* Fix new linting issues with import order

Also, update travis and tox config for multiple versions of python

* Another fix on travis envs
2017-06-14 09:38:03 -07:00
Hank Gay 64116bc541 Make a pass with futurize on stage 2.
Depend on futurize.
2017-05-30 18:10:44 -04:00
Hank Gay f201d150dd Make a pass w/ python-modernize. 2017-05-30 17:55:56 -04:00
CM Lubinski 47b62b2251 Fixup linting issues in the search module (#2884)
* Start of linting for search app.

* Combine several vars into a namedtuple.

Flake8 warned about using too many local vars. Combine that input into a
namedtuple and access the attributes from it.

* Remove unused argument.

* Split parse_sections function into two.

This uses `extend` as the logic currently allows documentation_type to include
both sphinx and mkdocs. If that doesn't make sense, let's simplify.

* Split process_file into a few functions.
2017-05-25 21:27:15 -07:00
Alex Chan 212be7e6b2 Docstring/PEP 257 fixes for the search app (#2824) 2017-05-09 17:36:39 -07:00
Eric Holscher 4a3e516e52 Validate the JSON file we're trying to load works.
This fixes errors on search indexing of files that don't fit the format.
This was triggering on eg. `searchindex.json` in the JSON builders
2017-03-27 16:58:59 -07:00
Anthony Johnson 3fcf523598 Lint project code
This lints project code to medium strictness and conforms to pep257. This uses
some additional options to reduce false errors, which I'll add in a separate PR.
This should pass our normal linting without a problem, except the minor change
to unused variable name regex.

This adds `__` to the default list of `_` and `dummy*` for unused arguments. I
prefer the default of `_`, but that overlaps with the translation helper `_()`.
I'd be happy to rethink a scheme here.
2015-08-21 17:30:56 -07:00
Gregor Müllegger 85c69ced90 Resolve linting messages in readthedocs.search.* 2015-07-31 17:51:11 +02:00
Rob Day f4b637193a Add explanatory comment 2015-02-11 08:36:49 +00:00
Rob Day 9103482b12 Strip trailing '.html' from paths before searching 2015-02-07 18:23:17 +00:00
Eric Holscher 07fc966ee3 Fix url parsing in mkdocs path 2014-10-13 19:44:28 -07:00
Eric Holscher d36e4cedd5 Clean up title indexing for mkdocs 2014-10-13 19:24:30 -07:00
Eric Holscher 92a183a56d Clean up mkdocs builder and search 2014-10-13 12:56:52 -07:00
Eric Holscher 3c6a35f1f8 Properly parse mkdocs output 2014-08-20 17:38:11 -07:00