searxng/docs/dev/quickstart.rst
Grant Lanham bce9669d74 Create a pre-commit hook which is copied on installation
Allow propogating specific files to format for black

Update build messages for black

update hook

Update hook further, add related doc
2024-08-26 22:00:59 -04:00

2.5 KiB

Development Quickstart

further read

  • makefile
  • buildhosts

SearXNG loves developers; Developers do not need to worry about tool chains, the usual developer tasks can be comfortably executed via make <makefile>.

Don't hesitate, just clone SearXNG's sources and start hacking right now ..

git clone https://github.com/searxng/searxng.git searxng

Here is how a minimal workflow looks like:

  1. start hacking
  2. run your code: make run
  3. format & test your code: make format.python and make test

Tip

If you run make install, and you export the environment variable SEARXNG_PRECOMMIT="true", a git pre-commit hook will run which will auto format all python files you check into git for you. If you find this would be better to enable by default, let us know.

If you think at some point something fails, go back to start. Otherwise, choose a meaningful commit message and we are happy to receive your pull request. To not end in wild west we have some directives, please pay attention to our "how to contribute" guideline.

further read

  • make nvm
  • make themes

If you implement themes, you will need to setup a Node.js environment <make node.env>: make node.env

Before you call make run (2.), you need to compile the modified styles and JavaScript: make themes.all

Alternatively you can also compile selective the theme you have modified, e.g. the simple theme.

make themes.simple

Tip

To get live builds while modifying CSS & JS use: LIVE_THEME=simple make run

further read

  • make static.build

If you finished your tests you can start to commit your changes. To separate the modified source code from the build products first run:

make static.build.restore

This will restore the old build products and only your changes of the code remain in the working tree which can now be added & committed. When all sources are committed, you can commit the build products simply by:

make static.build.commit

Committing the build products should be the last step, just before you send us your PR. There is also a make target to rewind this last build commit:

make static.build.drop