In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Facebook's open source projects.
If you submit a pull request to this project and you have never submitted a Facebook CLA, a GitHub Bot will comment on the pull request asking you to submit a CLA. Feel free to wait until then to submit it (it only takes a few seconds) or complete your CLA proactively, here: https://code.facebook.com/cla
If you'd like to implement new features, check out this projects GitHub Issues. Community contributions are welcomed and encouraged.
If you want to suggest a feature, you should create a GitHub issue outlining your feature request.
If you need help, have questions, or want to participate in a forum-style conversation with the core developers and users of this projects, create an issue.
Generally, use GitHub Issues for everything.
With the exception of the thrift autogenerated code, all code must be pylint
compliant. After installing pylint
and/or running pip install -r requirements.txt
from the root of this repository, run the following to lint the code:
python setup.py lint
Once you run that, a bunch of output will come out. The very last thing that lint should say is:
Global evaluation
-----------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
If the code rating has dropped below 10.00/10
, please fix the code so that it
is compliant.
Under the hood, python setup.py lint
just runs pylint
with a few options
on the relevant parts of the codebase. Sometime, pylint
is unreasonable. For
that reason, you may ignore specific messages on a file-by-file basis by
adding text like # pylint: disable=too-few-public-methods
to the top of your
file, right below the license docstring, before any imports.
If you'd like to edit the arguments that pylint
itself is ran with, edit the
PylintCommand
class' _pylint_arguments
property.
Ignoring lint warnings is generally not something you should default to doing. With great power comes great responsibility.
Generally, be consistent. We don't have a good auto-formatter configured, so ensure that the style of you code matches existing style. If you feel strongly that a given style in use throughout the codebase is egregious, feel free to submit a pull request with your update and we can discuss it's merits.
We adhere to PEP 8 for style, as well as PEP 257 for docstring conventions. If you notice that the codebase is not compliant with those specifications, please file an issue and/or submit a pull request with a patch.
To run the tests, run the following from the root of the repository:
# install dependencies
pip install -r requirements.txt
# build the module
python setup.py build
# test the module
python setup.py test
We build the osquery package as a wheel. To build the wheel, run the following from the root of this repository:
# install dependencies
pip install -r requirements.txt
# build package
python setup.py bdist_wheel
# upload the package
twine upload dist/*