-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add draft for the intro blog post on ci and linting #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach, but I don't think it's particularly clear to the novices we're targeting. I may be wrong though. What are your thoughts @alessandrofelder, I think you've taught things like this before?
Maybe we should get feedback from other, non SWEs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a license for this image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a photo from Unsplash, I have to reference the author
Imagine baking a cake. If you don't taste-test as you go, you might end up with a salty dessert. Without CI, small errors in code can create big problems later. | ||
|
||
## What about linting? | ||
Linting is like having a baking mentor who guides you on techniques, ensuring your cake rises perfectly every time. It points out potential issues in your recipe (code) so you can fix them before baking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this metaphor correct? I would think that this is closer to testing. Although linters can check for mistakes, it's testing that we usually use to make sure the code works properly.
### How does linting work? | ||
Linting is a process that checks your code for errors, bugs, and stylistic issues. It's like a **spell-checker** for code. Usually, you run it before committing your changes. It helps you maintain a consistent style and avoid errors, but differently from CI, it doesn't run your code. | ||
|
||
### What if I don't use linting? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure that this metaphor is helping. If you don't know anything about CI etc, I don't know that you would understand what the missing key ingredient is.
Without linting, you might not notice that your cake recipe (code) is missing a key ingredient. Linting helps you spot errors before they cause problems. | ||
|
||
### How can I automate linting? Use pre-commit hooks | ||
Pre-commit hooks are scripts that run before you commit your changes. They can be used to run linting automatically, so you don't have to remember to do it yourself. Tools like `black`, `mypy`, `ruff` can be called. They respectively check your code for style, type errors, and security issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do people know what "commiting" is out of context? Also, I would introduce the tools in more detail rather than just mentioning their names.
We haven't explained what we mean by "style" or "type". Also, does ruff check for security issues?
|
||
### What is the difference between `ruff` and `black`? | ||
`black` is a tool that checks your code for style issues. It's like a baking mentor who ensures your cake is always perfectly risen. | ||
`ruff` is an extremely fast Python linter that like a Swiss army knife, can be used to check for style and type errors. It's like a 5-star Michelin chef who ensures your cake is perfectly risen, and that you didn't accidentally add salt instead of sugar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I agree with the metaphor issue. Ruff mostly doesn't check that your cake works. It's still more about style. The difference (mostly, although this is changing) is that ruff identifies issues, and black fixes them.
|
Co-authored-by: Adam Tyson <[email protected]>
Thank you both for your feedback! 😀 It's hard to find the limit between maintaining the blog post short, simple and complete and at the same time avoid over simplification. I tried to do this by not getting into technical details and using a simple analogy, but it does not feel now that it works so well. IMO it is important to stress why these topics (linting, testing and CI) require attention from the reader more than explaining technically how they work. If I manage to make them interested, they could then be pointed to more exhaustive explanations. I think this needs to be an introductory simple blog post with all three. The three topics can be then discussed in detail somewhere else. Regarding the diataxis framework, it looks to me that this blog post falls in the category of explanations. I can try to follow those rules. |
This sounds right to me. We can follow up later with further information.
This is a blog post, not technically documentation, so I think you can write it however you like TBH. |
@lauraporta is there much more to do on this? It would be cool to get it released. |
@lauraporta just bumping this, it's been open for 7 months! It can always be closed and reopened later. |
Closing this PR for now, as I've not been working on it for a long time. |
Description
What is this PR
Why is this PR needed?
Starting the blog post series on CI and linting.
This the intro article that uses cooking metaphors 🍪 to introduce basic concepts that will be explained in detail in further articles. Let me know if these make sense to you!
A more detailed blogpost on linting will follow.
What does this PR do?
Adds the
.md
file with the article and a related image.References
From slack conversation:
How has this PR been tested?
Built locally, tested functionality of the website manually
Is this a breaking change?
No
Does this PR require an update to the documentation?
No
Checklist: