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

Style Guide #19

Merged
merged 10 commits into from
Jul 14, 2023
Merged

Conversation

bourque
Copy link
Collaborator

@bourque bourque commented Jul 7, 2023

This PR adds a project style guide

@bourque bourque self-assigned this Jul 7, 2023
@bourque bourque marked this pull request as draft July 7, 2023 21:49
Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice! Just some minor comments inline. I'd also suggest adding some comments about automatically checking things locally with pre-commit and how to get that set up. And also adding in some notes about black and ruff since those are what we are using to do our verification of these style "recommendations", meaning they are a little more than recommendations and leaning more towards requirements ;)

style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
@bourque bourque changed the title Style Guide [WIP] Style Guide Jul 10, 2023
@bourque
Copy link
Collaborator Author

bourque commented Jul 10, 2023

This is really nice! Just some minor comments inline. I'd also suggest adding some comments about automatically checking things locally with pre-commit and how to get that set up. And also adding in some notes about black and ruff since those are what we are using to do our verification of these style "recommendations", meaning they are a little more than recommendations and leaning more towards requirements ;)

@greglucas What is your workflow for setting up pre-commit and using black and ruff? I haven't used these before and i'm not familiar. I agree it would be good to add to this style guide but I just want to make sure I get it right.

@greglucas
Copy link
Collaborator

@greglucas What is your workflow for setting up pre-commit and using black and ruff? I haven't used these before and i'm not familiar. I agree it would be good to add to this style guide but I just want to make sure I get it right.

We should definitely add how to set those up and use them to the repository somewhere since they aren't in there yet, sorry about that! I made a rough cut of it in my docs PR:

https://github.com/IMAP-Science-Operations-Center/imap_processing/pull/15/files#diff-d7d2af9af9729ed1331913553f8232404d31175dfc64f8f0f3541b7f2b7bd417

with the gist being

pip install .[dev]
# Install the pre-commit hooks
pre-commit install

Then every git commit command will run those checks for you before allowing you to commit locally.

You can run black . to run black on all your files, or ruff . to run that on your files and also ruff --fix . to automatically fix the issues it finds and knows how to correct for you.

@bourque
Copy link
Collaborator Author

bourque commented Jul 10, 2023

Awesome, thanks @greglucas!

@bourque
Copy link
Collaborator Author

bourque commented Jul 10, 2023

@maxinelasp I added a (blank) section for poetry, you are welcome to add some notes there!

style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
@bourque bourque linked an issue Jul 10, 2023 that may be closed by this pull request
style_guide/README.md Outdated Show resolved Hide resolved
@bourque bourque marked this pull request as ready for review July 11, 2023 19:43
@bourque
Copy link
Collaborator Author

bourque commented Jul 11, 2023

I am finished with this draft and this is ready for review! I would like to hear what you all think should be added/removed/changed.

6. Follow agreed-upon [naming conventions](#naming-conventions) where applicable.
7. Use specific [tools and libraries](#tools-and-library-recommendations) where applicable.
8. Use nominal semantic versioning for [version numbers](#versioning).
9. Follow a specific [release workflow](#release-workflow) when making releases.

Copy link
Contributor

@maxinelasp maxinelasp Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be appropriate to add a note about testing or documentation here? Or is that not closely related to style? Actually, having a documentation style guide might be a good thing to add... (related to PR #15)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, now that #15 is merged and we have automated doc builds, I think it makes sense to add a note here about updating the necessary .rst files when applicable. I'll add that.

Beyond that, and beyond the mention of PEP257/numpydocs style, was there something else we could mention?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just adding to update or write the documentation as required is all that's needed right now, although I will maybe just write up a documentation specific style guide

style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@maxinelasp maxinelasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, I added a few suggestions but feel free to take them or leave them

@greglucas
Copy link
Collaborator

I think the content here is great!

I just merged the docs PR, so we have a documentation section now. Should we move this into the docs/ subfolder? Or should we even include it in the sphinx build as another page/heading? I think we could keep it as Markdown and use Myst for the restructured text conversion if you want, or you could update this file to restructured text as well.

Copy link
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great so far.

style_guide/README.md Outdated Show resolved Hide resolved
style_guide/README.md Show resolved Hide resolved
@bourque
Copy link
Collaborator Author

bourque commented Jul 12, 2023

Overall looks great, I added a few suggestions but feel free to take them or leave them

Thanks @maxinelasp! This is a good opportunity to try out this robot ...

@all-contributors please add @maxinelasp for the code review!

🙏🏻

@allcontributors
Copy link
Contributor

@bourque

I've put up a pull request to add @maxinelasp! 🎉

@bourque
Copy link
Collaborator Author

bourque commented Jul 12, 2023

I think the content here is great!

I just merged the docs PR, so we have a documentation section now. Should we move this into the docs/ subfolder? Or should we even include it in the sphinx build as another page/heading? I think we could keep it as Markdown and use Myst for the restructured text conversion if you want, or you could update this file to restructured text as well.

@greglucas As long as the style guide is easily findable/accessible, I don't really have a strong opinion on where it should live, so I will refer to whatever you advise on this!

@greglucas
Copy link
Collaborator

@greglucas As long as the style guide is easily findable/accessible, I don't really have a strong opinion on where it should live, so I will refer to whatever you advise on this!

I think this depends on how we expect users to find this information in the long run. Will they be going through an HTML documentation site, or do we expect them to be browsing the repository for this information? I don't personally know the answer to that, I'd probably lean towards HTML myself, looking at some "contributing" section.

Just fine to add this now, and then move it around later once we actually have documentation builds showing up somewhere.

@bourque bourque changed the title [WIP] Style Guide Style Guide Jul 12, 2023
@bourque
Copy link
Collaborator Author

bourque commented Jul 12, 2023

pre-commit.ci autofix

@bourque bourque requested a review from tech3371 July 14, 2023 18:09
style_guide/README.md Show resolved Hide resolved
@bourque bourque merged commit 7ca8d02 into IMAP-Science-Operations-Center:dev Jul 14, 2023
@bourque bourque deleted the style-guide branch July 14, 2023 19:17
laspsandoval pushed a commit to laspsandoval/imap_processing that referenced this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Style Guide
5 participants