Skip to content

Commit

Permalink
Merge pull request #13 from CaiqueCoelho/lint-pep8
Browse files Browse the repository at this point in the history
Add lint static code analysis for python and ipynb files
  • Loading branch information
Aatmaj-Zephyr authored Oct 28, 2023
2 parents 4139d84 + e724f18 commit 79116fa
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 25 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/[email protected]

- name: Set up Python environment
uses: actions/[email protected]
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 .
104 changes: 79 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@

</div>

_____________
---

## 📃 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)

<a name="aim"></a>

## 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.'**
Expand All @@ -27,9 +30,10 @@ _____________

![image](https://github.com/Aatmaj-Zephyr/handtype/assets/83284294/6144bccb-8576-41f9-86c8-f0f9e81002dc)

---

-------------
<a name="start"></a>

## Getting started with HandType

- Step 1: make your handwriting font at https://www.calligraphr.com/en/
Expand All @@ -41,65 +45,115 @@ _____________
- Step 7: Download the image. Enjoy!
- Step 8: Star this repository and follow me on github😇

-----------
---

<a name="contributing"></a>
## ⚒ 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: <br>

- 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.

<a name="hacktoberfest"></a>

## 👨‍💻 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!

<a name="lint"></a>

## ⚒ 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.

<a name="license"></a>

## 📄 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

<h4> Happy coding!~ </h4>

0 comments on commit 79116fa

Please sign in to comment.