|
| 1 | +# 🧰 Scripts Repository |
| 2 | + |
| 3 | +This repository contains a collection of base Python scripts that are invoked by the CI/CD processes of other repositories, especially the template repository. These scripts are used for formatting, checking files, version control, and updating the year in file headers or documentation. |
| 4 | + |
| 5 | +## 📚 Table of Contents |
| 6 | + |
| 7 | +- [Features](#-features) |
| 8 | +- [Getting Started](#-getting-started) |
| 9 | + - [Installation](#-installation) |
| 10 | +- [Contributing](#-contributing) |
| 11 | +- [License](#-license) |
| 12 | +- [Contact](#-contact) |
| 13 | + |
| 14 | +## 🌟 Features |
| 15 | + |
| 16 | +- **Formatting Scripts**: Format code files according to specified style guidelines. |
| 17 | +- **File Checking Scripts**: Check files for compliance, correctness, and other criteria. |
| 18 | +- **Version Control Scripts**: Manage version numbers in your project. |
| 19 | +- **Year Update Scripts**: Update the year in file headers or documentation. |
| 20 | + |
| 21 | +## 🚀 Getting Started |
| 22 | + |
| 23 | +To use these scripts in your project, add this repository as a submodule. |
| 24 | + |
| 25 | +### 🔨 Installation |
| 26 | + |
| 27 | +1. Add the scripts repository as a submodule in your project: |
| 28 | + |
| 29 | + ```bash |
| 30 | + git submodule add https://github.com/JuanVilla424/scripts.git |
| 31 | + ``` |
| 32 | + |
| 33 | + or, using branch |
| 34 | + |
| 35 | + ```bash |
| 36 | + git submodule add -b <branch_name> https://github.com/JuanVilla424/scripts.git |
| 37 | + ``` |
| 38 | + |
| 39 | +2. Update the submodule when there are changes: |
| 40 | + |
| 41 | + ```bash |
| 42 | + git submodule update --remote --merge |
| 43 | + ``` |
| 44 | + |
| 45 | +## 🤝 Contributing |
| 46 | + |
| 47 | +**Contributions are welcome! To contribute to this repository, please follow these steps**: |
| 48 | + |
| 49 | +1. **Fork the Repository** |
| 50 | + |
| 51 | +2. **Create a Feature Branch** |
| 52 | + |
| 53 | + ```bash |
| 54 | + git checkout -b feature/your-feature-name |
| 55 | + ``` |
| 56 | + |
| 57 | +3. **Commit Your Changes** |
| 58 | + |
| 59 | + ```bash |
| 60 | + git commit -m "feat(<scope>): your feature commit message - lower case" |
| 61 | + ``` |
| 62 | + |
| 63 | +4. **Push to the Branch** |
| 64 | + |
| 65 | + ```bash |
| 66 | + git push origin feature/your-feature-name |
| 67 | + ``` |
| 68 | + |
| 69 | +5. **Open a Pull Request into** `dev` **branch** |
| 70 | + |
| 71 | +Please ensure your contributions adhere to the Code of Conduct and Contribution Guidelines. |
| 72 | + |
| 73 | +### 🔧 Environment Setup |
| 74 | + |
| 75 | +**Mandatory: Setting Up a Python Virtual Environment** |
| 76 | + |
| 77 | +Setting up a Python virtual environment ensures that dependencies are managed effectively and do not interfere with other projects. |
| 78 | + |
| 79 | +1. **Create a Virtual Environment** |
| 80 | + |
| 81 | + ```bash |
| 82 | + python -m venv venv |
| 83 | + ``` |
| 84 | + |
| 85 | +2. **Activate the Virtual Environment** |
| 86 | + |
| 87 | + On Unix or MacOS: |
| 88 | + |
| 89 | + ```bash |
| 90 | + source venv/bin/activate |
| 91 | + ``` |
| 92 | + |
| 93 | + On Windows: |
| 94 | + |
| 95 | + ```bash |
| 96 | + powershell.exe -ExecutionPolicy Bypass -File .\venv\Scripts\Activate.ps1 |
| 97 | + ``` |
| 98 | + |
| 99 | +3. **Upgrade pip** |
| 100 | + |
| 101 | + ```bash |
| 102 | + python -m ensurepip |
| 103 | + pip install --upgrade pip |
| 104 | + ``` |
| 105 | + |
| 106 | +4. **Install Dependencies** |
| 107 | + |
| 108 | + ```bash |
| 109 | + pip install -r requirements.txt |
| 110 | + pip install poetry |
| 111 | + poetry lock |
| 112 | + poetry install |
| 113 | + ``` |
| 114 | + |
| 115 | + - Deactivate the Virtual Environment |
| 116 | + |
| 117 | + When you're done, deactivate the environment: |
| 118 | + |
| 119 | + ```bash |
| 120 | + deactivate |
| 121 | + ``` |
| 122 | + |
| 123 | +### 🛸 Pre-Commit Hooks |
| 124 | + |
| 125 | +**Install and check pre-commit hooks**: MD files changes countermeasures, python format, python lint, yaml format, yaml lint, version control hook, changelog auto-generation |
| 126 | + |
| 127 | +```bash |
| 128 | +pre-commit install |
| 129 | +pre-commit install -t pre-commit |
| 130 | +pre-commit install -t pre-push |
| 131 | +pre-commit autoupdate |
| 132 | +pre-commit run --all-files |
| 133 | +``` |
| 134 | + |
| 135 | +## 📫 Contact |
| 136 | + |
| 137 | +For any inquiries or support, please open an issue or contact [[email protected]](mailto:[email protected]). |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## 📜 License |
| 142 | + |
| 143 | +2024 - This project is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). You are free to use, modify, and distribute this software under the terms of the GPL-3.0 license. For more details, please refer to the [LICENSE](LICENSE) file included in this repository. |
0 commit comments