contribution_guide.rst 5.1 KB

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