Thank you for your interest in contributing to the Temperature Converter Console App! We welcome contributions from developers of all skill levels. This document provides guidelines and information on how to contribute effectively to this project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Commit Guidelines
- Pull Request Process
- Issue Guidelines
- Testing
- Documentation
- Community
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before you begin, ensure you have the following installed:
- .NET Core 3.1 or later
- Git for version control
- Visual Studio, Visual Studio Code, or any C# compatible IDE
- Basic knowledge of C# programming language
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/Temperature-Converter-Console-App.git cd Temperature-Converter-Console-App - Add the original repository as upstream:
git remote add upstream https://github.com/Mostafa-SAID7/Temperature-Converter-Console-App.git
There are many ways you can contribute to this project:
- Report bugs through GitHub Issues
- Use the bug report template
- Include steps to reproduce, expected behavior, and actual behavior
- Suggest new features through GitHub Issues
- Use the feature request template
- Explain the use case and potential implementation
- Fix bugs
- Implement new features
- Improve existing functionality
- Add tests
- Improve documentation
- Improve existing documentation
- Add code comments
- Create tutorials or examples
- Update README files
-
Clone and setup the project as described in Getting Started
-
Build the project:
dotnet build
-
Run the application:
dotnet run
-
Run tests (when available):
dotnet test
Temperature-Converter-Console-App/
βββ Program.cs # Main application entry point
βββ TemperatureConverter.cs # Core conversion logic
βββ Models/ # Data models (if applicable)
βββ Services/ # Business logic services
βββ Tests/ # Unit tests
βββ docs/ # Additional documentation
βββ README.md # Project documentation
Follow Microsoft's C# Coding Conventions:
// Use PascalCase for classes, methods, and properties
public class TemperatureConverter
{
public double ConvertCelsiusToFahrenheit(double celsius) { }
public string UserInput { get; set; }
}
// Use camelCase for local variables and parameters
public void ProcessTemperature(double inputValue)
{
double convertedValue = inputValue * 1.8 + 32;
}
// Use UPPER_CASE for constants
public const double ABSOLUTE_ZERO_CELSIUS = -273.15;- One class per file with meaningful names
- Methods should be focused and do one thing well
- Use meaningful variable names that describe their purpose
- Add XML documentation for public methods and classes
/// <summary>
/// Converts temperature from Celsius to Fahrenheit
/// </summary>
/// <param name="celsius">Temperature in Celsius</param>
/// <returns>Temperature in Fahrenheit</returns>
/// <exception cref="ArgumentException">Thrown when celsius is below absolute zero</exception>
public double ConvertCelsiusToFahrenheit(double celsius)
{
if (celsius < ABSOLUTE_ZERO_CELSIUS)
throw new ArgumentException("Temperature cannot be below absolute zero");
return (celsius * 9.0 / 5.0) + 32.0;
}- Write clean, readable code with proper indentation
- Use meaningful comments to explain complex logic
- Handle exceptions appropriately with try-catch blocks
- Validate input parameters before processing
- Follow SOLID principles where applicable
- Write unit tests for new functionality
Use the following format for commit messages:
<type>(<scope>): <subject>
<body>
<footer>
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code formatting changes
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
feat(converter): add Kelvin to Rankine conversion
Add support for converting temperatures from Kelvin to Rankine scale.
Includes input validation and error handling.
Closes #15fix(validation): handle negative Kelvin temperatures
Fix bug where negative Kelvin values were not properly validated.
Kelvin temperatures below absolute zero should throw an exception.
Fixes #23-
Sync with upstream:
git fetch upstream git checkout main git merge upstream/main
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the coding standards
-
Test your changes thoroughly
-
Commit your changes with clear commit messages
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Detailed description of what was changed and why
- Reference to related issues (if applicable)
- Screenshots (if UI changes are involved)
## Description
Brief description of changes made.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Code refactoring
## Testing
- [ ] Tested locally
- [ ] Added unit tests
- [ ] Updated documentation
## Related Issues
Closes #[issue-number]
## Screenshots (if applicable)
Add screenshots here if relevant.- All PRs require review before merging
- Address reviewer feedback promptly
- Keep PRs focused - one feature/fix per PR
- Be responsive to questions and suggestions
When reporting bugs, please include:
- Clear title summarizing the issue
- Steps to reproduce the bug
- Expected behavior vs actual behavior
- System information (OS, .NET version, etc.)
- Screenshots or error messages (if applicable)
When requesting features, please include:
- Clear description of the proposed feature
- Use case - why is this feature needed?
- Acceptance criteria - how will we know it's complete?
- Possible implementation ideas (optional)
We use the following labels to organize issues:
- bug: Something isn't working
- enhancement: New feature or improvement
- documentation: Documentation needs
- good first issue: Good for newcomers
- help wanted: Extra attention needed
- question: General questions
- Write unit tests for new functionality
- Test edge cases and error conditions
- Use descriptive test names that explain what is being tested
- Follow AAA pattern: Arrange, Act, Assert
[Test]
public void ConvertCelsiusToFahrenheit_WithValidInput_ReturnsCorrectValue()
{
// Arrange
var converter = new TemperatureConverter();
double celsius = 100.0;
double expected = 212.0;
// Act
double result = converter.ConvertCelsiusToFahrenheit(celsius);
// Assert
Assert.AreEqual(expected, result, 0.001);
}- All existing tests pass
- New tests are added for new functionality
- Tests cover both success and failure scenarios
- Tests are well-documented and maintainable
- Keep documentation up-to-date with code changes
- Use clear, concise language
- Include code examples where helpful
- Document public APIs with XML comments
- Update README when adding new features
- Code Comments: Explain complex logic
- XML Documentation: For public methods and classes
- README Updates: For new features or setup changes
- Wiki Pages: For detailed guides or tutorials
- GitHub Issues: For bug reports and feature requests
- GitHub Discussions: For general questions and community chat
- Email: Contact maintainers directly for sensitive issues
Contributors will be recognized in:
- README.md contributors section
- Release notes for significant contributions
- GitHub contributors page
- Unit Testing: Add comprehensive test coverage
- Input Validation: Improve error handling and validation
- Additional Scales: Support for Rankine and RΓ©aumur
- GUI Version: Windows Forms or WPF interface
- Web API: REST API for temperature conversions
- Mobile App: Cross-platform mobile application
- Batch Processing: File-based bulk conversions
- Internationalization: Multi-language support
If you have any questions about contributing, please:
- Check existing documentation and issues first
- Open a new issue with the "question" label
- Contact the maintainers directly if needed
Thank you for contributing to the Temperature Converter Console App! π‘οΈ
Happy Coding! π
This document is a living guide and may be updated as the project evolves. Please check back regularly for updates.