-
Notifications
You must be signed in to change notification settings - Fork 40
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
Style #196
Comments
Hi @BjornFJohansson, sounds good to me. This was not yet implement in |
Yes I run this before every commit. This means that the code is formatted automatically. Not nicer everywhere, but should be consistent. |
Hi @BjornFJohansson I wonder if there are better ways to do this that don't involve asking the users to install pre-commit. We could add The advantage of something like this is that we can create a separate file with the rules we want black and flake8 to implement that are also interpreted by the IDE as you write. The IDE would show you the syntax suggestions in real time, and also allow you to format on save, what do you think? I have done this before with a repo. Also, we could add a github action to check syntax if tests pass? |
Sounds like a good idea. Do you have this running already? |
I can give it a go eventually, I will assign myself to the issue. In the meantime, can you include the instructions on how to install pre-commit and use it in the readme? |
Will do |
69b7ec7 on the dev_bjorn branch has the instructions. for installing it is simply
|
Hi @BjornFJohansson I have some suggestions on how to incorporate this in poetry, so that it comes as you do [tool.poetry.group.dev.dependencies]
autopep8 = "^2.1.0"
black = "^24.4.1"
flake8-bugbear = [
{version = ">=24.4.21", python = ">=3.8.1"},
]
pre-commit = [
{version = ">3.6", python = ">=3.9"},
{version = "<3.6", python = "<3.9"},
] Let me know where should I target with my PR, and I will add this. Also, you mentioned that 69b7ec7 containted the instructions, but I can't see a README with those instructions anymore. Maybe this commit got lost? |
Hi, Ill have a look and get back to you asap. |
I use pre-commit https://pre-commit.com with this settings file: .pre-commit-config.yaml
This autoformats the code before each commit. The pyproject.toml contains:
This means that the line lenght will be 119 which I think is used by the django project.
@manulera , do you agree with this ocr do you have another suggestion?
The text was updated successfully, but these errors were encountered: