Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: use linting tools (pre-commit) #60

Open
2 tasks done
Ananya2001-an opened this issue Jun 9, 2023 · 9 comments
Open
2 tasks done

🚀 Feature: use linting tools (pre-commit) #60

Ananya2001-an opened this issue Jun 9, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@Ananya2001-an
Copy link

🔖 Feature description

I think we can use famous linting tools like black, flake8 and isort to keep the code style consistent and maybe we can use pre-commit hook to make sure the format is correct before making any unnecessary commits.

In some files like here:

we have unused imports like io in this case which can be easily detected using something like this. We can use husky as well....

We can also later on add a ci workflow to make sure lint tests pass. wdyt?

🎤 Pitch

We can use pre-commit as a dev dependency and create a .pre-commit-config.yaml file in the root dir like this:

repos:
- repo: https://github.com/psf/black
  rev: 23.3.0
  hooks:
    - id: black
      language_version: python3
      args: [appwrite]
- repo: https://github.com/pycqa/flake8
  rev: 5.0.4
  hooks:
    - id: flake8
      args:
        - "--max-line-length=120"
- repo: https://github.com/pycqa/isort
  rev: 5.11.5
  hooks:
    - id: isort
      name: isort (python)
      args: [--filter-files]

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Ananya2001-an
Copy link
Author

I wonder if there is a common formatting being followed in sdk-generator for all SDKs using composer that's why we are not implementing something like this separately?

@jayanth-kumar-morem
Copy link

I'm interested in implementing this feature. I agree that using linting tools like black, flake8, and isort can significantly improve the consistency of our code style. The pre-commit hook idea is also excellent as it can prevent unnecessary commits with incorrect formatting.

I have experience working with these tools. Can someone please assign this task to me?

CC: @eldadfux @TorstenDittmann @christyjacob4

@Ananya2001-an
Copy link
Author

Hey @jayanth-kumar-morem it's great that u want to contribute but just a suggestion that please don't tag the maintainers directly for getting assigned to some issue

@jayanth-kumar-morem
Copy link

Okay, Alright, should I draft a PR then ?

@Ananya2001-an
Copy link
Author

You should wait for someone to approve this first

@jayanth-kumar-morem
Copy link

Oh, Alright @Ananya2001-an

@joeyouss
Copy link

Thank you for opening this @Ananya2001-an - our SDKs are actually generated via https://github.com/appwrite/sdk-generator so it is an important consideration about where to add it, how to add it, automating it, etc so a deeper look at this is required. I will be looking into this and letting you know what the decision is.

@Ananya2001-an
Copy link
Author

Sure @joeyouss :)

@vaishnavi-2901
Copy link

Is this still open?
will attach pre-commit hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants