From ff026855fff479fa9c78eb9b4f49e013f10ef3cf Mon Sep 17 00:00:00 2001 From: Caique Coelho Date: Fri, 27 Oct 2023 09:48:24 -0300 Subject: [PATCH 1/2] Add lint static code analysis for python and ipynb files --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..36318d0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@v4.1.1 + + - name: Set up Python environment + uses: actions/setup-python@v4.7.1 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + pip install nbqa flake8 + + - name: Run flake8 on notebooks + run: | + nbqa flake8 *.ipynb + + - name: Run flake8 + run: | + flake8 . From e724f1874022260b12e4ce739c390c60091aa0c9 Mon Sep 17 00:00:00 2001 From: Caique Coelho Date: Fri, 27 Oct 2023 10:38:34 -0300 Subject: [PATCH 2/2] readme update --- README.md | 104 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 20714fb..e423289 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,19 @@ -_____________ +--- + +## πŸ“ƒ Table of Contents -## πŸ“ƒ Table of Contents 1. [Aim](#aim) 2. [Getting started with HandType](#start) 3. [How to Contribute?](#contributing) 4. [Open for Hacktoberfest!](#hacktoberfest) -5. [License](#license) +5. [Lint](#lint) +6. [License](#license) + ## Aim **To convert text to handwriting in a seemingly authentic manner. To achieve a realistic conversion of typed text into handwritten-style content, creating a genuine vintage appearance through deep learning techniques, commonly referred to as 'deep faking.'** @@ -27,9 +30,10 @@ _____________ ![image](https://github.com/Aatmaj-Zephyr/handtype/assets/83284294/6144bccb-8576-41f9-86c8-f0f9e81002dc) +--- -------------- + ## Getting started with HandType - Step 1: make your handwriting font at https://www.calligraphr.com/en/ @@ -41,65 +45,115 @@ _____________ - Step 7: Download the image. Enjoy! - Step 8: Star this repository and follow me on githubπŸ˜‡ ------------ +--- -## βš’ How to Contribute? + +## βš’ How to Contribute? 1. Find Issue - -- go to the Issues tab of the repository and click on the issue you want to work on. + +- go to the Issues tab of the repository and click on the issue you want to work on. - Under that issue, write a comment asking permission for the admin of the repository to assign you the issue you want to work on. -- For example, - ``` - I would like to work on this issue. Can you assign it to me? - ``` +- For example, + ``` + I would like to work on this issue. Can you assign it to me? + ``` + 2. Fork the Repository:
+ - Click the "Fork" button in the upper-right corner of the repository's page. This creates a copy (fork) of the repository in your GitHub account. 3. **Clone the Repository**: Clone your forked repository to your local machine using the following command: ```bash - + git clone https://github.com/Aatmaj-Zephyr/handtype.git - + ``` -3. Create a Branch: Create a new branch for your work with a descriptive name. Use the following format: + +4. Create a Branch: Create a new branch for your work with a descriptive name. Use the following format: ```bash git checkout -b feature/your-feature-name ``` + Prefix your branch name with "feature/" for feature additions, "bugfix/" for bug fixes, or choose an appropriate prefix that reflects the purpose of your branch. -4. Make Changes: Implement your changes and ensure that they adhere to our coding and style guidelines. +5. Make Changes: Implement your changes and ensure that they adhere to our coding and style guidelines. -5. Commit Your Changes: Commit your changes with a meaningful commit message. Include a reference to relevant issues or pull requests. +6. Commit Your Changes: Commit your changes with a meaningful commit message. Include a reference to relevant issues or pull requests. ```bash git commit -m "Add your descriptive commit message here" ``` -6. Push to Your Fork: Push your branch to your forked repository on GitHub. + +7. Push to Your Fork: Push your branch to your forked repository on GitHub. ```bash git push origin feature/your-feature-name ``` -7. Open a Pull Request: Go to the original repository on GitHub and click the "New Pull Request" button. Provide a clear and concise title and description for your pull request, and reference any related issues. +8. Open a Pull Request: Go to the original repository on GitHub and click the "New Pull Request" button. Provide a clear and concise title and description for your pull request, and reference any related issues. + ## πŸ‘¨β€πŸ’» Open for Hacktoberfest! - - Fix known issues - - Add new issues - - Ask for an issue to be assigned to you - - Make a Pull Request - - Bag a PR! +- Fix known issues +- Add new issues +- Ask for an issue to be assigned to you +- Make a Pull Request +- Bag a PR! + + + +## βš’ Lint + +This repository ensures the quality of Jupyter `.ipynb` notebooks by integrating a linting process using GitHub Actions. Here's a brief overview of how it works and why it's essential: + +### Overview + +Jupyter notebooks, while extremely versatile, pose a challenge when it comes to maintaining code quality. They intermingle code, output, and markdown in a JSON format, which makes traditional Python linting tools incompatible with `.ipynb` files out of the box. + +To address this challenge, we use a tool called `nbqa`. `nbqa` acts as a bridge, allowing us to run popular Python linting tools, like `flake8`, directly on Jupyter notebooks. + +### How It Works + +1. **Setting Up Locally**: Before pushing to the repository, you can check for linting errors locally. To do this, ensure you have `nbqa` and `flake8` installed: + + ```bash + pip install nbqa flake8 + ``` + + With the tools installed, you can lint your notebooks: + + ```bash + nbqa flake8 handtype.ipynb + ``` + +This command will highlight any linting errors in your notebook based on PEP-8 standards. + +2. **GitHub Actions Integration**: Every time you push your changes or create a pull request, GitHub Actions will automatically run the linting checks on all notebooks in the repository. This process ensures that any new or modified notebooks adhere to our coding standards. + +### Why It's Important + +Linting provides several benefits: + +- Consistency: It ensures a uniform coding style across notebooks, which is especially important in collaborative projects. +- Error Reduction: Linting helps catch and reduce errors, leading to more reliable notebooks. +- Best Practices: Linting encourages adherence to best practices, resulting in better and more readable code. + +We strongly encourage all contributors to run the linting checks locally before pushing, to ensure faster integration and fewer CI build failures. + ## πŸ“„ License + [MIT](https://github.com/Aatmaj-Zephyr/handtype/blob/main/LICENSE) ------- +--- + **Note:** Currently, work in progress of making the paper folded in the centre using image processing for a more faking effect. It currently is just a google collab file, but let's see what happens in the future. #goOpenSource

Happy coding!~