|
| 1 | +# Contributing to NETCore.Keycloak |
| 2 | + |
| 3 | +We love your input! We want to make contributing to NETCore.Keycloak as easy and transparent as possible, whether it's: |
| 4 | + |
| 5 | +- Reporting a bug |
| 6 | +- Discussing the current state of the code |
| 7 | +- Submitting a fix |
| 8 | +- Proposing new features |
| 9 | +- Becoming a maintainer |
| 10 | + |
| 11 | +## Development Process |
| 12 | + |
| 13 | +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. |
| 14 | + |
| 15 | +### Branch Naming Convention |
| 16 | + |
| 17 | +All branch names must follow this format: |
| 18 | +``` |
| 19 | +(feature|bugfix|hotfix|docs|refactor)/[a-z0-9_]{5,50} |
| 20 | +``` |
| 21 | + |
| 22 | +This means: |
| 23 | +- Start with one of these prefixes: `feature/`, `bugfix/`, `hotfix/`, `docs/`, `refactor/` |
| 24 | +- Followed by a description that: |
| 25 | + - Is 5-50 characters long |
| 26 | + - Uses only lowercase letters (a-z), numbers (0-9), and underscores (_) |
| 27 | + - No spaces, hyphens, or special characters allowed |
| 28 | + |
| 29 | +Examples: |
| 30 | +- `feature/add_token_refresh` |
| 31 | +- `bugfix/fix_auth_flow_123` |
| 32 | +- `hotfix/security_patch_456` |
| 33 | +- `docs/update_readme_789` |
| 34 | +- `refactor/simplify_code_101` |
| 35 | + |
| 36 | +### Pull Request Process |
| 37 | + |
| 38 | +1. Fork the repo and create your branch from `main` following the branch naming convention |
| 39 | +2. Ensure your code follows the existing code style and formatting rules defined in `.editorconfig` |
| 40 | +3. Update the documentation if needed |
| 41 | +4. Ensure all tests pass |
| 42 | +5. Create a Pull Request with a clear title and description |
| 43 | + |
| 44 | +### Code Style Guidelines |
| 45 | + |
| 46 | +We use `.editorconfig` to maintain consistent coding styles. Some key points: |
| 47 | +- Use tabs for indentation |
| 48 | +- Maximum line length is 120 characters |
| 49 | +- UTF-8 encoding |
| 50 | +- Trim trailing whitespace |
| 51 | +- Insert final newline |
| 52 | +- Follow C# naming conventions |
| 53 | +- Use proper spacing and bracing rules as defined in `.editorconfig` |
| 54 | + |
| 55 | +#### Documentation Requirements |
| 56 | +- All public APIs must be documented using XML documentation comments |
| 57 | +- Documentation should follow the standard XML format: |
| 58 | + ```csharp |
| 59 | + /// <summary> |
| 60 | + /// Brief description of what the method/class does |
| 61 | + /// </summary> |
| 62 | + /// <param name="parameterName">Description of the parameter</param> |
| 63 | + /// <returns>Description of the return value</returns> |
| 64 | + /// <exception cref="ExceptionType">When the exception is thrown</exception> |
| 65 | + ``` |
| 66 | +- Include code examples in documentation when the usage is not immediately obvious |
| 67 | +- Keep comments up to date with code changes |
| 68 | +- Use clear and concise language |
| 69 | +- Document non-obvious implementation details or business logic |
| 70 | +- Include references to related documentation or external resources when applicable |
| 71 | + |
| 72 | +### Commit Message Guidelines |
| 73 | + |
| 74 | +- Use the present tense ("Add feature" not "Added feature") |
| 75 | +- Use the imperative mood ("Move cursor to..." not "Moves cursor to...") |
| 76 | +- Limit the first line to 72 characters or less |
| 77 | +- Reference issues and pull requests liberally after the first line |
| 78 | + |
| 79 | +### Security |
| 80 | + |
| 81 | +- Never commit sensitive information (API keys, credentials, etc.) |
| 82 | +- Follow SAST (Static Application Security Testing) rules defined in `.editorconfig` |
| 83 | +- Report security vulnerabilities privately to the maintainers |
| 84 | + |
| 85 | +## License |
| 86 | + |
| 87 | +By contributing, you agree that your contributions will be licensed under the same license as the project. |
| 88 | + |
| 89 | +## Questions? |
| 90 | + |
| 91 | +Don't hesitate to open an issue for any questions or concerns. |
0 commit comments