Skip to content

Contribution guide #7

@hsluoyz

Description

@hsluoyz
  1. Our build system is makefile (on Linux) & Visual Studio project files (on Windows). We don't use cross-platform building tools like CMake because I think it only makes things more complicated. Just maintaining two native build systems (makefile and Visual Studio) is easier and more friendly to users. Casbin is a library instead of app, so I must choose something used more widely. Please make your code compile well on both platforms before any PR. I personally will test the code on Visual Studio and CLion on Windows.
  2. We use Google test as the test framework.
    3. Use use namespace std;, there should be no std::string in the code. [Abandoned]
  3. The allowed source file name's extensions are .cpp and .h. Others like .cc, .hpp are forbidden.
  4. Write minimized working code first, like file adapter, model, enforcer. Don't try to setup a code framework, or something like CI, linter only. I cannot witness those things work well without concrete code.
  5. Use printf instead of cout. No cout will be allowed in the code.
  6. Follow the module (filename) naming of Golang Casbin: https://github.com/casbin/casbin . Do not invent a name by yourself.
  7. Your code in PR should compile well itself on Windows and Linux, better with tests. Do not leave a feature in half, which has 100+ compile errors and then send PR.
  8. Base your code on our latest master branch, follow our folder structure, filename naming, etc.
  9. Do not use CMake or any cross-platform building tools (I have to say it again).
  10. Don't commit so many code in one PR. One PR can only contain one commit, with 100 LoC change.
  11. Other things please follow Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions