Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Add Docstring linter - #23

Merged
jacobbieker merged 20 commits into
mainfrom
jacob/docstring
Sep 16, 2021
Merged

jacobbieker merged 20 commits into
mainfrom
jacob/docstring

Conversation

@jacobbieker

@jacobbieker jacobbieker commented Sep 16, 2021 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

This adds a check and pre-commit hook for Google formatted dosctrings.

How Has This Been Tested?

This PR should test nowcasting_utils on every push

  • No
  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@JackKelly

Copy link
Copy Markdown
Contributor

Awesome! Forgive my naivete but is there any way to have this setup for all our Python repos in one go? I guess assume not?!

@peterdudfield

peterdudfield commented Sep 16, 2021 •

Copy link
Copy Markdown
Contributor

Well this is hugely useful - https://github.com/openclimatefix/nowcasting_utils/runs/3622549429

Do you think its worth sorting these before merging? I'd happily help. One person start from the bottom, one person start from the top

@jacobbieker

Copy link
Copy Markdown
Contributor Author

Awesome! Forgive my naivete but is there any way to have this setup for all our Python repos in one go? I guess assume not?!

Unfortunately it doesn't seem like it. The .github repo only syncs templates and Contributer.md/funding.md and those kinds of files. There does not seem to be a way to sync workflow and GitHub Actions across all of them.

@peterdudfield

Copy link
Copy Markdown
Contributor

Awesome! Forgive my naivete but is there any way to have this setup for all our Python repos in one go? I guess assume not?!

Unfortunately it doesn't seem like it. The .github repo only syncs templates and Contributer.md/funding.md and those kinds of files. There does not seem to be a way to sync workflow and GitHub Actions across all of them.

We can make a meta-repo (another one) and then when you start a repo you can copy from this blank one.
Perhaps we havent got to many, so we can just copy them over

@jacobbieker

Copy link
Copy Markdown
Contributor Author

Well this is hugely useful - https://github.com/openclimatefix/nowcasting_utils/runs/3622549429

Do you think its worth sorting these before merging? I'd happily help. One person start from the bottom, one person start from the top

Possibly, yeah, so then its passing the tests. Maybe we split it? I can write ones for the stuff from SatFlow, and you write the ones from predict_pv_yield?

@JackKelly

JackKelly commented Sep 16, 2021 •

Copy link
Copy Markdown
Contributor

On the topic of whether we should turn off all the warnings about whitespace... I know it's painful now, and really tedious, but I'd vote for keeping most of (all of?!?) the whitespace warnings. I've just skimread the list of warnings and they seem vaguely sane :) (but I'm a pedant!). And maybe we can review after a few days to see if it's hurting productivity?!? Hopefully, whilst it's painful right now, we should get into the swing of things fairly soon?!

@jacobbieker

Copy link
Copy Markdown
Contributor Author

On the topic of whether we should turn off all the warnings about whitespace... I know it's painful now, and really tedious, but I'd vote for keeping most of (all of?!?) the whitespace warnings. I've just skimread the list of warnings and they seem vaguely sane. And maybe we can review after a few days to see if it's hurting productivity?!? Hopefully, whilst it's painful right now, we should get into the swing of things fairly soon?!

Yeah, I'd probably agree. Its just going to be painful, especially on ones with a lot more code than this one. This one being fairly small is the reason I tried it here first to see how many there would be.

@jacobbieker

Copy link
Copy Markdown
Contributor Author

On the topic of whether we should turn off all the warnings about whitespace... I know it's painful now, and really tedious, but I'd vote for keeping most of (all of?!?) the whitespace warnings. I've just skimread the list of warnings and they seem vaguely sane. And maybe we can review after a few days to see if it's hurting productivity?!? Hopefully, whilst it's painful right now, we should get into the swing of things fairly soon?!

Yeah, I'd probably agree. Its just going to be painful, especially on ones with a lot more code than this one. This one being fairly small is the reason I tried it here first to see how many there would be.

But once its fixed, it should be a lot better going forward, and makes the code a lot more uniform and readable I think

@JackKelly JackKelly mentioned this pull request Sep 16, 2021
@JackKelly JackKelly linked an issue Sep 16, 2021 that may be closed by this pull request
@JackKelly

Copy link
Copy Markdown
Contributor

Modifying the docstrings to pass the linter's requirements could make a great "first issue" for people who are new to the codebase :) (not very sexy work, though!)... I'll add issues to the repos and mark them "great first issue"

@jacobbieker
jacobbieker merged commit 2a6014d into main Sep 16, 2021
@jacobbieker
jacobbieker deleted the jacob/docstring branch September 16, 2021 16:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a docstring linter

3 participants