Files
ocis/vendor/github.com/mna/pigeon/CONTRIBUTING.md
Florian Schade c0553c7273 [full-ci] enhancement: add more kql spec tests and simplify ast normalization (#7254)
* enhancement: add more kql spec tests and simplify ast normalization

* enhancement: kql parser error if query starts with AND

* enhancement: add kql docs and support for date and time only dateTimeRestriction queries

* enhancement: add the ability to decide how kql nodes get connected

connecting nodes (with edges) seem straight forward when not using group, the default connection for nodes with the same node is always OR. THis only applies for first level nodes, for grouped nodes it is defined differently. The KQL docs are saying, nodes inside a grouped node, with the same key are connected by a AND edge.

* enhancement: explicit error handling for falsy group nodes and queries with leading binary operator

* enhancement: use optimized grammar for kql parser and toolify pigeon

* enhancement: simplify error handling

* fix: kql implicit 'AND' and 'OR' follows the ms html spec instead of the pdf spec
2023-09-11 13:49:53 +02:00

2.8 KiB

Contributing to pigeon

There are various ways to help support this open source project:

  • if you use pigeon and find it useful, talk about it - that's probably the most basic way to help any open-source project: getting the word out that it exists and that it can be useful
  • if you use pigeon and find bugs, please file an issue
  • if something is poorly documented, or doesn't work as documented, this is also a bug, please file an issue
  • if you can fix the issue (whether it is documentation- or code-related), then submit a pull-request - but read on to see what should be done to get it merged
  • if you would like to see some new feature/behaviour being implemented, please first open an issue to discuss it because features are less likely to get merged compared to bug fixes

Submitting a pull request

Assuming you already have a copy of the repository (either via go get, a github fork, a clone, etc.), you will also need make to regenerate all tools and files generated when a dependency changes. I use GNU make version 4.1, other versions of make may work too but haven't been tested.

Run make in the root directory of the repository. That will create the bootstrap builder, the bootstrap parser, and the final parser, along with some generated Go files. Once make is run successfully, run go test ./... in the root directory to make sure all tests pass.

Once this is done and tests pass, you can start implementing the bug fix (or the new feature provided it has already been discussed and agreed in a github issue first).

For a bug fix, the best way to proceed is to first write a test that proves the bug, then write the code that fixes the bug and makes the test pass. All other tests should still pass too (unless it relied on the buggy behaviour, in which case existing tests must be fixed).

For a new feature, it must be thoroughly tested. New code without new test(s) is unlikely to get merged.

Respect the coding style of the repository, which means essentially to respect the coding guidelines of the Go community. Use gofmt to format your code, and goimports to add and format the list of imported packages (or do it manually, but in a goimports-style).

Once all code is done and tests pass, regenerate the whole tree with make, run make lint to make sure the code is correct, and run tests again. You are now ready to submit the pull request.

Licensing

All pull requests that get merged will be made available under the BSD 3-Clause license (see the LICENSE file for details), as the rest of the pigeon repository. Do not submit pull requests if you do not want your contributions to be made available under those terms.