Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pre-commit

on:
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v5
with:
# requites to grab the history of the PR
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
with:
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
38 changes: 0 additions & 38 deletions .github/workflows/style.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
exclude: |
(?x)^(
keyvi/3rdparty/.*
)$
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.2
hooks:
- id: clang-format
exclude: '^(.*/3rdparty/.*)'
- repo: https://github.com/cpplint/cpplint
rev: 2.0.2
hooks:
- id: cpplint
exclude: '^(.*/3rdparty/.*)'
- repo: local
hooks:
- id: cargo-fmt
name: cargo-fmt
entry: cargo fmt --manifest-path rust/Cargo.toml -- --check
language: system
pass_filenames: false
types:
- rust
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.14.0"
hooks:
- id: ruff-check
- id: ruff-format
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You will need to fork the repository and clone it to your local machine. See [gi

### Submitting your changes

Once you successfully tested you are ready to submit for review. Note that some parts have to fulfill certain rules (e.g. formating), please have a look and do the changes accordingly. We will not do it for you.
Once you successfully tested you are ready to submit for review. Note that some parts have to fulfill certain rules (e.g. formating), please have a look and do the changes accordingly. All checks must pass.

#### Submit a pull request

Expand All @@ -30,6 +30,6 @@ Please be as reviewer friendly as possible:

By contributing to the project:

- You agree to publish your work under the licence of the project: Apache 2.0
- You agree to publish your work under the licence of the project: Apache 2.0
- You represent and warrant that you are the exclusive owner of the Copyright in the Contribution
- If your contribution contains 3rdparty code you provide details about licence and restriction
10 changes: 0 additions & 10 deletions keyvi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,3 @@ to build on the commandline (in addition cmake creates Visual Studio configs):
```
cmake --build . --config Release
```

## Coding Rules

The cpp part of keyvi has to pass the [https://pypi.python.org/pypi/cpplint](cpplint) checks as well as [https://clang.llvm.org/docs/ClangFormat.html](clang-format) (5.0.0 at the moment, defined by our travis CI configuration).

The configuration of both tools is part of the project. You can check your changes against the config using the `check-style.sh` script. For your convenience consider using a plugin for your IDE of choice (e.g. CppStyle for Eclipse).

Formatting is not done automatically for you but code neads to be cleanly pushed.

The check must pass for all changed, including new, files.
44 changes: 0 additions & 44 deletions keyvi/check-style.sh

This file was deleted.

10 changes: 3 additions & 7 deletions keyvi/include/keyvi/dictionary/match.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* * keyvi - A key value store.
/* keyvi - A key value store.
*
* Copyright 2015 Hendrik Muhs<[email protected]>
*
Expand Down Expand Up @@ -234,9 +234,7 @@ struct Match {
*
* @param value
*/
void SetRawValue(const std::string& value) {
raw_value_ = value;
}
void SetRawValue(const std::string& value) { raw_value_ = value; }

private:
size_t start_ = 0;
Expand All @@ -254,9 +252,7 @@ struct Match {
template <class MatcherT, class DeletedT>
friend match_t index::internal::FirstFilteredMatch(const MatcherT&, const DeletedT&);

fsa::automata_t& GetFsa() {
return fsa_;
}
fsa::automata_t& GetFsa() { return fsa_; }
};

} /* namespace dictionary */
Expand Down
Loading