Skip to content

Commit

Permalink
chore(docs): Fix & Improve contribution docs
Browse files Browse the repository at this point in the history
This commit fixes some broken links, updates the building & testing
documentation and adds a few badges.
  • Loading branch information
LeonMatthesKDAB committed Jul 23, 2024
1 parent 3cbb216 commit 9e99512
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 11 deletions.
14 changes: 14 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@
"name": "clazy",
"inherits": "ci",
"configurePreset": "clazy"
},
{
"name": "debug",
"inherits": "ci",
"configurePreset": "debug",
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "debug-asan",
"inherits": "debug",
"configurePreset": "debug-asan"
}
]
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Knut

[![GitHub branch status](https://img.shields.io/github/checks-status/KDAB/knut/main?logo=github)](https://github.com/KDAB/knut/actions)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSES/GPL-3.0-only.txt)
[![MkDocs](https://img.shields.io/badge/MkDocs-526CFE?logo=materialformkdocs&logoColor=fff)](https://kdab.github.io/knut/)

Knut is an automation tool for code transformation using scripts. The main use case is for migration, but it could be used elsewhere.

The scripts are written either in javascript or QML languages, the latter being able to display a user interface to customize some parts of the application.
Expand Down Expand Up @@ -67,6 +71,14 @@ e.g.:
./build-release/bin/knut
```

# Documentation

Visit our comprehensive documentation here: https://kdab.github.io/knut/contributing/getting-involved.html

# Contributing

For information about contributing to Knut, see the ["Contributing guide"](https://kdab.github.io/knut/contributing/getting-involved.html) in our documentation.

# About KDAB

Knut is written and maintained by Klarälvdalens Datakonsult AB (KDAB).
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ High-level architecture description.

`KnutCore` is the central object in the application (module **core**), and is created in the `main.cpp`:

- create the application singletons: [`Project`](../API/script/project.md), [`Settings`](../API/script/settings.md) and `ScriptManager`
- create the application singletons: [`Project`](../API/knut/project.md), [`Settings`](../API/knut/settings.md) and `ScriptManager`
- read parameters from the command line

`KnutMain` is a subclass (module **gui**) that adds the gui specific parameters.
Expand Down
25 changes: 19 additions & 6 deletions docs/contributing/getting-involved.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@ Please submit your contributions or issue reports from our GitHub space at <http

## Compilation

To compile Knut, you need:
For instructions on how to build and run Knut, refer to the [Building Section in the project README](https://github.com/kdab/knut?tab=readme-ov-file#building).

- a C++20 compiler (recent compilers should work)
- Qt 6.2 at least
For development, you will likely want to use the `debug` or `debug-asan` CMake presets.
Simply replace `--preset=release` with `--preset=debug` in the CMake calls.

All 3rd-party dependencies are set up as git submodules, make sure to run:
Note that if you're building with the `debug-asan`, asan will likely detect a few leaks from the larger dependencies like Qt, or even some drivers.
This is mostly okay, and we haven't set up comprehensive suppressions, so they are expected.

```
git submodule update --init --recursive
However, to avoid the tests failing, set the environment variable `ASAN_OPTIONS=detect_leaks=0` when running ctest.

### Testing Knut

To test Knut, use `ctest` or `ctest --preset=...` with the preset you used for building.

Some useful ctest options include:

- `-j$(nproc)` - runs multiple tests in parallel which can considerably speed up testing
- `--output-on-failure`

When building with `--preset=debug-asan` you will likely want to disable leak checking:
```bash
ASAN_OPTIONS=detect_leaks=0 ctest -j$(nproc) --preset=debug-asan --output-on-failure
```

### Qt Creator compilation error on Windows
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/unit-tests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unit tests

There are 2 different kinds of unit-tests: C++ and script. THey are located in the `tests` directory, with all test data in the `test_data` directory.
There are 2 different kinds of unit-tests: C++ and script. They are located in the `tests` directory, with all test data in the `test_data` directory.

## C++ unit-tests

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/treesitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ Note that for most operations, using [`CppDocument::mfcExtractMessageMap`][extra
[queries]: https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries
[destructuring]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment?retiredLocale=de
[template-literals]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals?retiredLocale=de
[extract-message-map]: ../API/script/cppdocument.md#mfcExtractMessageMap
[querymatch]: ../API/script/querymatch.md
[codedocument-query]: ../API/script/codedocument.md#query
[extract-message-map]: ../API/knut/cppdocument.md#mfcExtractMessageMap
[querymatch]: ../API/knut/querymatch.md
[codedocument-query]: ../API/knut/codedocument.md#query

0 comments on commit 9e99512

Please sign in to comment.