Thank you for your interest in contributing to Linux-Projects! This document provides guidelines and information for contributors.
- Getting Started
- How to Contribute
- Code Style Guidelines
- Testing Guidelines
- Pull Request Process
- Reporting Issues
- Contact Information
- Basic knowledge of Linux and Bash scripting
- Git installed on your system
- A text editor (VS Code, Vim, Nano, etc.)
- For testing: Bats-core framework (optional but recommended)
-
Fork the Repository
# Fork the repository on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/Linux-Projects.git cd Linux-Projects
-
Set Up Upstream Remote
git remote add upstream https://github.com/akintunero/Linux-Projects.git
-
Create a New Branch
git checkout -b feature/your-feature-name
We welcome various types of contributions:
- Bug Fixes: Fix issues in existing scripts or documentation
- New Features: Add new scripts, tutorials, or learning materials
- Documentation: Improve README files, add comments, or create new guides
- Testing: Add tests for existing scripts or improve test coverage
- Code Quality: Refactor code, improve error handling, or enhance security
- Location:
updated_bash_projects/,Basic_Projects/ - Requirements:
- Add proper error handling
- Include input validation
- Add usage examples
- Follow security best practices
- Location: All directories with README files
- Requirements:
- Clear and concise writing
- Include prerequisites
- Add troubleshooting sections
- Provide usage examples
- Location:
30_days_of_bash/,beginner_to_advanced_linux_projects/ - Requirements:
- Accurate and up-to-date information
- Progressive difficulty levels
- Practical examples
- Clear explanations
-
Shebang and Options
#!/bin/bash set -euo pipefail # Exit on error, undefined vars, pipe failures
-
Variable Naming
# Use descriptive names in UPPER_CASE for constants readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Use descriptive names in lowercase for variables local file_path="$1"
-
Function Definitions
# Use descriptive function names and add comments function validate_input() { # Validate that input is not empty if [[ -z "$1" ]]; then echo "Error: Input cannot be empty" >&2 return 1 fi }
-
Error Handling
# Always check for errors if ! command; then echo "Error: command failed" >&2 exit 1 fi
-
README Files
- Start with a brief description
- Include prerequisites
- Provide usage examples
- Add troubleshooting section
- Include contribution guidelines
-
Code Comments
- Explain complex logic
- Document function parameters
- Include usage examples
- Add security considerations
-
Install Bats
# On macOS brew install bats-core # On Ubuntu/Debian (manual installation required) git clone https://github.com/bats-core/bats-core.git cd bats-core sudo ./install.sh /usr/local cd .. rm -rf bats-core # Alternative: Use package manager if available sudo apt-get install bats # Some distributions have this package
-
Create Test Files
# Test file naming: script_name_test.sh # Example: todo_manager_test.sh
-
Write Tests
#!/usr/bin/env bats @test "todo list add functionality" { run ./todo_manager.sh add "test task" [ "$status" -eq 0 ] [ "$output" = "Task added successfully." ] } @test "todo list remove functionality" { # Setup: add a task first echo "test task" > todo_list.txt run ./todo_manager.sh remove 1 [ "$status" -eq 0 ] [ "$output" = "Task removed successfully." ] }
# Run all tests
bats test/
# Run specific test file
bats test/todo_manager_test.sh
# Run with verbose output
bats --verbose test/-
Test Your Changes
# Run existing tests bats test/ # Test your specific changes ./your_script.sh
-
Check Code Quality
# Use shellcheck for bash scripts shellcheck your_script.sh # Check for common issues bash -n your_script.sh # Syntax check
-
Update Documentation
- Update relevant README files
- Add comments to new code
- Update any affected documentation
-
Create a Descriptive Title
- Use present tense ("Add feature" not "Added feature")
- Be specific about the change
-
Write a Detailed Description
## Description Brief description of what this PR does. ## Changes Made - List specific changes - Include any new files added - Mention any files modified ## Testing - Describe how you tested the changes - Include test results if applicable ## Checklist - [ ] Code follows style guidelines - [ ] Tests pass - [ ] Documentation updated - [ ] No breaking changes
-
Link Issues
- If fixing an issue, use "Fixes #123"
- If related to an issue, use "Related to #123"
-
Automated Checks
- GitHub Actions will run tests
- Code quality checks will be performed
- All checks must pass
-
Code Review
- At least one maintainer will review
- Address any feedback provided
- Make requested changes if needed
-
Merge
- Once approved, your PR will be merged
- Your contribution will be included in the next release
-
Check Existing Issues
- Search for similar issues
- Check if the issue is already reported
-
Gather Information
- OS and version
- Bash version (
bash --version) - Steps to reproduce
- Expected vs actual behavior
## Bug Report
### Environment
- OS: [e.g., Ubuntu 20.04, macOS 12.0]
- Bash Version: [e.g., 5.1.16]
- Script: [e.g., todo_manager.sh]
### Description
Brief description of the issue.
### Steps to Reproduce
1. Run command: `./script.sh`
2. Provide input: `example`
3. See error: `error message`
### Expected Behavior
What you expected to happen.
### Actual Behavior
What actually happened.
### Additional Information
Any other relevant information, logs, or screenshots.- Name: Olúmáyòwá Akinkuehinmi
- Email: akintunero101@gmail.com
- Twitter: @akintunero
- LinkedIn: olumayowaa
- Issues: Use GitHub Issues for bug reports and feature requests
- Discussions: Use GitHub Discussions for general questions
- Email: For sensitive matters or detailed discussions
Contributors will be recognized in the following ways:
- Listed in the CONTRIBUTORS.md file
- Mentioned in release notes
- Invited to join the maintainers team for significant contributions
Thank you for contributing to Linux-Projects! Your contributions help make this a valuable resource for the Linux and Bash scripting community.