|
1 | | -# Contributing |
| 1 | +# Contributing 🤝 |
2 | 2 |
|
3 | | -Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. |
| 3 | +Thank you for your interest in contributing to this project! Your help makes it better for everyone. |
4 | 4 |
|
5 | | -Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md). |
| 5 | +## Code of Conduct 📝 |
6 | 6 |
|
7 | | -Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. |
| 7 | +By participating, you agree to abide by our [Contributor Code of Conduct](CODE_OF_CONDUCT.md). |
8 | 8 |
|
9 | | -## Submitting a pull request |
| 9 | +## Getting Started |
10 | 10 |
|
11 | | -1. [Fork][fork] and clone the repository |
12 | | -2. Make sure the tests pass on your machine: `./tests/run-tests.sh` |
13 | | - - Tests can be run from VSCode |
14 | | -3. Create a new branch: `git checkout -b my-branch-name` |
15 | | -4. Make your change, add tests, and make sure the tests still pass |
16 | | -5. Push to your fork and [submit a pull request][pr] |
17 | | -6. Pat yourself on the back and wait for your pull request to be reviewed and merged. |
| 11 | +### Build the extractor |
18 | 12 |
|
19 | | -Here are a few things you can do that will increase the likelihood of your pull request being accepted: |
| 13 | +To build the extractor, use the following command: |
20 | 14 |
|
21 | | -- Write tests. |
22 | | -- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. |
23 | | -- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). |
| 15 | +```sh |
| 16 | +./scripts/create-extractor-pack.sh |
| 17 | +``` |
| 18 | + |
| 19 | +This will create the extractor pack in the `./extractor-pack` directory. |
| 20 | + |
| 21 | +### Installing Dependencies |
| 22 | + |
| 23 | +To install the dependencies of the queries, run the following command: |
| 24 | + |
| 25 | +```sh |
| 26 | +codeql pack install ./ql/lib |
| 27 | +``` |
| 28 | + |
| 29 | +This will install the necessary dependencies for the library queries. |
| 30 | +Alternatively, you can install them using VSCode's CodeQL extension. |
| 31 | + |
| 32 | +### Compiling the Library |
| 33 | + |
| 34 | +To compile the library queries, run: |
| 35 | + |
| 36 | +```sh |
| 37 | +codeql pack create ./ql/lib |
| 38 | +``` |
| 39 | + |
| 40 | +You can also install these packs into the CodeQL home directory using: |
| 41 | + |
| 42 | +```sh |
| 43 | +codeql pack install --output=$HOME/.codeql/packages ./ql/lib |
| 44 | +``` |
| 45 | + |
| 46 | +This will allow your to use the library on your local machine with CodeQL CLI. |
| 47 | + |
| 48 | +### Run Tests |
| 49 | + |
| 50 | +To run all tests: |
| 51 | + |
| 52 | +```sh |
| 53 | +./scripts/run-tests.sh |
| 54 | +``` |
| 55 | + |
| 56 | +Or use VSCode's test runner for supported tests. |
| 57 | + |
| 58 | +## Submitting a Pull Request |
| 59 | + |
| 60 | +1. Fork and clone the repository |
| 61 | +2. Create a new branch: `git checkout -b my-feature` |
| 62 | +3. Make your changes and add tests if needed |
| 63 | +4. Ensure all tests pass |
| 64 | +5. Push your branch and open a pull request |
| 65 | + |
| 66 | +### Tips for a Successful PR |
| 67 | + |
| 68 | +- Keep changes focused and minimal |
| 69 | +- Write clear commit messages |
| 70 | +- Add or update tests as needed |
| 71 | + |
| 72 | +## Reporting Issues & Discussions |
| 73 | + |
| 74 | +- Report bugs or request features via [GitHub Issues](https://github.com/advanced-security/codeql-extractor-iac/issues) |
| 75 | +- Use [GitHub Discussions](https://github.com/advanced-security/codeql-extractor-iac/discussions) for questions and ideas |
| 76 | + |
| 77 | +## License 📄 |
| 78 | + |
| 79 | +Contributions are released under the [MIT License](LICENSE.md). |
24 | 80 |
|
25 | 81 | ## Resources |
26 | 82 |
|
27 | 83 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) |
28 | 84 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) |
29 | 85 | - [GitHub Help](https://help.github.com) |
30 | 86 |
|
31 | | -[fork]: https://github.com/advanced-security/codeql-extractor-iac/fork |
32 | | -[pr]: https://github.com/advanced-security/codeql-extractor-iac/compare |
33 | | -[code-of-conduct]: CODE_OF_CONDUCT.md |
| 87 | +--- |
| 88 | + |
| 89 | +If you have any questions, open an issue or start a discussion. Thank you for helping improve this project! 🚀 |
0 commit comments