๐ค Contributing Guide - FluxSharp
Guidelines for contributing to FluxSharp. We welcome all contributions!
Table of Contents
- Getting Started
- Types of Contributions
- Development Setup
- Submitting Changes
- Code Guidelines
- Documentation Guidelines
- Community
Getting Started
Prerequisites
Git
Rust toolchain (1.56+)
C/C++ compiler
Basic knowledge of FluxSharp
Fork and Clone
Fork the repository on GitHub
Clone your fork:
git clone https://github.com/YOUR_USERNAME/flux-sharp.git
Add upstream:
git remote add upstream https://github.com/Yvan4001/FluxSharp.git
Create a branch:
git checkout -b feature/my-feature
Set Up Development Environment
cd flux-sharp
cd fluxcompiler
cargo build
cd ..
Types of Contributions
๐ Bug Fixes
Found a bug? Help us fix it! Steps:
Create an issue describing the bug
Fork and create a feature branch
Write a test that reproduces the bug
Fix the bug
Ensure tests pass
Submit a pull request
Example:
Issue: Array out of bounds returns wrong error message
Fix: Update error message in bounds checking code
Test: testoutofboundserrormessage()
โจ Features
Want to add a new feature? Steps:
Discuss in an issue first (for major features)
Implement the feature with tests
Document the feature
Submit a pull request
Respond to feedback
๐ Documentation
Help improve documentation! Types:
Fix typos and grammar
Add examples
Clarify explanations
Add tutorials
Update guides
How:
Edit
.md
files in the
docs/
folder
Add/improve examples
Verify all links work
Submit a pull request
๐งช Tests
Improve test coverage! Areas:
Edge cases
Error conditions
Performance scenarios
Integration tests
Example:
void testArrayBoundsMultipleAccess() {
int[] arr = new int[5];
// Test multiple accesses
// Test boundary conditions
// Test error handling
}
๐ก Ideas & Discussion
Have ideas? Share them!
Open an issue to discuss
Share use cases
Suggest improvements
Provide feedback
Development Setup
Build the Compiler
cd fluxcompiler
cargo build --release
cd ..
Create Test Files
# Create a test program
echo 'class Main {
public void main() {
print("Hello from test!");
}
}' > test.fsh
Run it
./build.sh test.fsh
Run Tests
# Run all tests
cargo test --all
Run specific test
cargo test testname
Run with output
cargo test -- --nocapture
Create Examples
Place examples in
examples/
:
examples/
โโโ 01helloworld.fsh
โโโ 02variables.fsh
โโโ 03functions.fsh
โโโ 04_classes.fsh
Submitting Changes
Commit Messages
Write clear, descriptive commit messages:
# โ Good
commit: Add bounds checking for arrays
Implement runtime bounds verification
Add error messages
Update documentation
โ Good
commit: Fix compilation error in class methods
โ Bad
commit: fix stuff
commit: update
Pull Request Process
- Update your branch:
``
bash
git fetch upstream
git rebase upstream/main
`
- Commit your changes:
`
bash
git add .
git commit -m "Clear description of changes"
`
- Push to your fork:
`
bash
git push origin feature/my-feature
`
- Create Pull Request:
Go to GitHub
Click "New Pull Request"
Fill in the template
Link any related issues
- PR Template:
`
markdown
## Description
What does this PR do?
## Related Issues
Closes #123
## Changes
Change 1
Change 2
Change 3
## Testing
How was this tested?
## Checklist
[ ] Code follows style guidelines
[ ] Tests added/updated
[ ] Documentation updated
[ ] No breaking changes
`
- Respond to Feedback:
Address review comments
Push new commits
Don't force-push (keep history)
Code Guidelines
Style
Follow existing code style
Use 4-space indentation
Keep lines under 100 characters
Use descriptive names
Naming Conventions
// Classes - PascalCase
class UserManager { }
// Methods - camelCase
public void calculateTotal() { }
// Variables - camelCase
int userCount = 0;
// Constants - UPPERSNAKECASE
int MAX_ATTEMPTS = 3;
Comments
// โ Good - Explains why
// Perform bounds checking before array access
// This prevents buffer overflow attacks
if (index >= array.length()) {
throw new Exception("Index out of bounds");
}
// โ Bad - States obvious
// Check index
if (index >= array.length()) {
throw new Exception("Index out of bounds");
}
Error Handling
// โ Good
try {
processData(data);
} catch (IOException e) {
print("Failed to process data: " + e);
throw new Exception("Processing failed");
}
// โ Bad
try {
processData(data);
} catch (Exception e) {
// ignore
}
Testing
// Write tests for all changes
void testNewFeature() {
// Arrange
int input = 5;
// Act
int result = calculate(input);
// Assert
assert(result == 10);
}
Documentation Guidelines
Markdown Files
Use clear headings (H1, H2, H3)
Include examples
Link to related docs
Keep explanations simple
Example Documentation
## Topic Title
Brief introduction.
Subsection
Explanation of concept.
Example
\
\
\
rust
// code example
\
\
\`
Related
Code Examples
Must be correct and runnable
Include comments for clarity
Show common use cases
Highlight best practices
Documentation Template
For new features:
Overview - What it does
Syntax - How to use it
Examples - Working code
Best Practices - Do's and don'ts
Related Links - See also sections
Community
Communication Channels
GitHub Issues - Bug reports, feature requests
GitHub Discussions - General discussion
GitHub Pull Requests - Code review
Documentation - Best practices and guides
Code of Conduct
Be respectful and inclusive:
โ Do be friendly and professional
โ Do respect different perspectives
โ Do provide constructive feedback
โ Don't be offensive or dismissive
โ Don't spam or flood
โ Don't post private information
Recognition
Contributors are recognized in:
CONTRIBUTORS file
Release notes
GitHub contributors page
Getting Help
Questions
Check existing documentation
Search GitHub issues
Ask in discussions
Comment on related issues
Stuck on Something?
Read the error message carefully
Check documentation relevant to the error
Search existing issues
Ask for help with context and details
Need Review?
For significant changes:
Create a draft PR first
Ask for early feedback
Be open to suggestions
Iterate together
Recognition & Thanks
First Time Contributing?
Thank you! We appreciate:
Bug reports
Documentation improvements
Code fixes
Testing and feedback
Regular Contributors
We value your ongoing:
Code reviews
Mentoring new contributors
Documentation maintenance
Community support
Maintainers
Special thanks to:
Project founders
Core maintainers
Active contributors
Community members
Common Questions
Q: Can I contribute without coding?
A: Absolutely! We need:
Documentation writers
Translators
Testers
Community managers
Example creators
Q: How long until my PR is reviewed?
A: Usually within 1-2 weeks. High-priority items may be faster.
Q: Can I suggest a major feature?
A: Yes! Open an issue to discuss first. We appreciate your ideas.
Q: Do I need to sign a CLA?
A: Check the repository for current requirements.
Q: Can I contribute anonymously?
A: Contributions are tied to GitHub accounts, but you can use a pseudonym.
Resources
- GitHub: FluxSharp on GitHub
- Issues: Report a bug or suggest a feature
- Discussions: Join the community
- Documentation: Contributing docs
Thank You! ๐
Contributing to FluxSharp helps make it better for everyone. Your time and effort are greatly appreciated! Happy Contributing! ๐
Last Updated: April 9, 2026 Status: Active โ The FluxSharp project welcomes all contributions, from code to documentation to community support.