Thank you for considering contributing to PolyglotCode! Your support and collaboration are greatly appreciated.
-
Fork the Repository
- Click the "Fork" button on the top right of this repository's page to create your own copy of the project.
- Clone your forked repository to your local machine:
git clone https://github.com/mulla028/PolyglotCode.git
- Navigate into the project directory:
cd PolyglotCode
-
Setting Up Your Environment
- Ensure you have Java and Maven installed.
- Generate and provide your Cohere API key into the
defaultValueof the-aand--api-keyflags inside the main class:@Option( names = {"-a", "--api-key"}, defaultValue = "YOUR_API-KEY", description = "Modifying API key manually" ) private String api;
- Alternatively, you can specify the API key when running the tool (see "Usage").
-
Build and Test
- Make the bash script executable:
chmod +x polyglot
- Compile the source code using Maven:
mvn package
- Run and test the tool to ensure everything works correctly.
- Make the bash script executable:
-
Create Your Contribution
- Make changes or add new features in your local repository.
- Please write clear, concise, and well-documented code.
- Ensure that your code follows the style and conventions of the project.
-
Commit Your Changes
- Create a new branch for your feature or fix:
git checkout -b feature-name
- Commit your changes with a descriptive commit message:
git add . git commit -m "Add a concise description of your change"
- Create a new branch for your feature or fix:
-
Push to Your Fork
- Push your branch to your forked repository:
git push origin feature-name
- Push your branch to your forked repository:
-
Submit a Pull Request (PR)
- Go to the original repository and create a pull request from your forked repository.
- Provide a clear description of the changes you've made and the problem it solves or feature it adds.
- Reference any related issues in the pull request description if applicable.
-
Follow the Coding Standards
- Use appropriate naming conventions and indentation.
- Ensure your code is clean and well-documented.
-
Document Your Changes
- Update the
README.mdfile if your changes include new features or configurations. - Include examples of how to use new features if applicable.
- Update the
-
Testing and Validation
- Before submitting your PR, thoroughly test your code.
- Ensure that your contribution does not break existing functionality.
We use Checkstyle to ensure that our code adheres to a consistent style. Before submitting your pull request, please run Checkstyle to check for any code style violations.
To run Checkstyle on the project, follow these steps:
-
Ensure Checkstyle is Configured: Make sure the
checkstyle.xmlconfiguration file is in place. This file defines the rules for code style checks. -
Run Checkstyle: Open your terminal, navigate to the project directory, and execute the following command:
mvn checkstyle:check
-
Review Output After running the Checkstyle check, review the output in the terminal for any errors or warnings and resolve them accordingly.
We use Spotless with Google Java Format to ensure consistent code style. Before submitting your changes, please format your code.
- Open your terminal and navigate to the project's root directory.
- Run the following command to format all source code:
mvn spotless:apply
Upon successful creation of new model or method every developer will be asked to implement unit and integration tests.
- Open
testfolder and navigate yourself tojavaorintegrationdirectory according to what test you implement. unit=javaintegration=integration
Using JUnit principals we are able to run all the tests using one command:
mvn testor using @Tag annotation we may separate them and run:
mvn test -Dgroups=<TagName>- Use the GitHub Issues section to report bugs or suggest features.
- When reporting a bug, provide as much detail as possible, including:
- Steps to reproduce the issue
- Your environment details (Java version, operating system, etc.)
- Any relevant error messages or logs
- License: By contributing, you agree that your contributions will be licensed under the MIT License.
- Community: Be respectful and considerate of others. We value open communication and constructive feedback.
Happy coding, and thank you for contributing to PolyglotCode!