contribution_guide.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. .. _how to contribute:
  2. =================
  3. How to contribute
  4. =================
  5. .. contents:: Contents
  6. :depth: 2
  7. :local:
  8. :backlinks: entry
  9. Prime directives: Privacy, Hackability
  10. ======================================
  11. Searx has two prime directives, **privacy-by-design and hackability** . The
  12. hackability comes in three levels:
  13. - support of search engines
  14. - plugins to alter search behaviour
  15. - hacking searx itself
  16. Note the lack of "world domination" among the directives. Searx has no
  17. intention of wide mass-adoption, rounded corners, etc. The prime directive
  18. "privacy" deserves a separate chapter, as it's quite uncommon unfortunately.
  19. Privacy-by-design
  20. -----------------
  21. Searx was born out of the need for a **privacy-respecting** search tool which
  22. can be extended easily to maximize both, its search and its privacy protecting
  23. capabilities.
  24. A few widely used features work differently or turned off by default or not
  25. implemented at all **as a consequence of privacy-by-design**.
  26. If a feature reduces the privacy preserving aspects of searx, it should be
  27. switched off by default or should not implemented at all. There are plenty of
  28. search engines already providing such features. If a feature reduces the
  29. protection of searx, users must be informed about the effect of choosing to
  30. enable it. Features that protect privacy but differ from the expectations of
  31. the user should also be explained.
  32. Also, if you think that something works weird with searx, it's might be because
  33. of the tool you use is designed in a way to interfere with the privacy respect.
  34. Submitting a bugreport to the vendor of the tool that misbehaves might be a good
  35. feedback to reconsider the disrespect to its customers (e.g. ``GET`` vs ``POST``
  36. requests in various browsers).
  37. Remember the other prime directive of searx is to be hackable, so if the above
  38. privacy concerns do not fancy you, simply fork it.
  39. *Happy hacking.*
  40. Code
  41. ====
  42. .. _PEP8: https://www.python.org/dev/peps/pep-0008/
  43. .. _Conventional Commits: https://www.conventionalcommits.org/
  44. .. _Git Commit Good Practice: https://wiki.openstack.org/wiki/GitCommitMessages
  45. .. _Structural split of changes:
  46. https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes
  47. .. _gitmoji: https://gitmoji.carloscuesta.me/
  48. .. _Semantic PR: https://github.com/zeke/semantic-pull-requests
  49. .. sidebar:: Create good commits!
  50. - `Structural split of changes`_
  51. - `Conventional Commits`_
  52. - `Git Commit Good Practice`_
  53. - some like to use: gitmoji_
  54. - not yet active: `Semantic PR`_
  55. In order to submit a patch, please follow the steps below:
  56. - Follow coding conventions.
  57. - PEP8_ standards apply, except the convention of line length
  58. - Maximum line length is 120 characters
  59. - The cardinal rule for creating good commits is to ensure there is only one
  60. *logical change* per commit / read `Structural split of changes`_
  61. - Check if your code breaks existing tests. If so, update the tests or fix your
  62. code.
  63. - If your code can be unit-tested, add unit tests.
  64. - Add yourself to the :origin:`AUTHORS.rst` file.
  65. - Choose meaningful commit messages, read `Conventional Commits`_
  66. .. code::
  67. <type>[optional scope]: <description>
  68. [optional body]
  69. [optional footer(s)]
  70. - Create a pull request.
  71. For more help on getting started with searx development, see :ref:`devquickstart`.
  72. Translation
  73. ===========
  74. Translation currently takes place on :ref:`transifex <translation>`.
  75. .. caution::
  76. Please, do not update translation files in the repo.
  77. .. _contrib docs:
  78. Documentation
  79. =============
  80. .. _Sphinx: https://www.sphinx-doc.org
  81. .. _reST: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
  82. .. sidebar:: The reST sources
  83. has been moved from ``gh-branch`` into ``master`` (:origin:`docs`).
  84. The documentation is built using Sphinx_. So in order to be able to generate
  85. the required files, you have to install it on your system. Much easier, use
  86. our :ref:`makefile`.
  87. Here is an example which makes a complete rebuild:
  88. .. code:: sh
  89. $ make docs.clean docs.html
  90. ...
  91. The HTML pages are in dist/docs.
  92. .. _make docs.live:
  93. live build
  94. ----------
  95. .. _sphinx-autobuild:
  96. https://github.com/executablebooks/sphinx-autobuild/blob/master/README.md
  97. .. sidebar:: docs.clean
  98. It is recommended to assert a complete rebuild before deploying (use
  99. ``docs.clean``).
  100. Live build is like WYSIWYG. If you want to edit the documentation, its
  101. recommended to use. The Makefile target ``docs.live`` builds the docs, opens
  102. URL in your favorite browser and rebuilds every time a reST file has been
  103. changed.
  104. .. code:: sh
  105. $ make docs.live
  106. ...
  107. The HTML pages are in dist/docs.
  108. ... Serving on http://0.0.0.0:8000
  109. ... Start watching changes
  110. Live builds are implemented by sphinx-autobuild_. Use environment
  111. ``$(SPHINXOPTS)`` to pass arguments to the sphinx-autobuild_ command. Except
  112. option ``--host`` (which is always set to ``0.0.0.0``) you can pass any
  113. argument. E.g to find and use a free port, use:
  114. .. code:: sh
  115. $ SPHINXOPTS="--port 0" make docs.live
  116. ...
  117. ... Serving on http://0.0.0.0:50593
  118. ...
  119. .. _deploy on github.io:
  120. deploy on github.io
  121. -------------------
  122. To deploy documentation at :docs:`github.io <.>` use Makefile target :ref:`make
  123. docs.gh-pages`, which builds the documentation and runs all the needed git add,
  124. commit and push:
  125. .. code:: sh
  126. $ make docs.clean docs.gh-pages