You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stickler CI will remain available in a read only fashion until June 30 2023.. After that, login will cease to work and the site will fall off the internet.
That website seems to suggest that it should still be working for the moment, but @AdamRJensen noticed that it's not reporting a status to #1395, so it might be inactive already for us.
Thinking about how we might replace it: instead of using an external service, pvanalytics and twoaxistracking both DIY with a custom flake8 action. This approach doesn't comment in-line like stickler does, which is a downside especially for new contributors. Probably there are nicer pre-built linter services we could switch to.
I'm ok with the custom action, but my preference is to embrace the dark side and go black. I don't expect consensus on this and I'm not going to push it today. I just want to use this opportunity to plant a seed in your minds :) See details below for our new AI overlord's vision of a world in black
Details
(Verse 1)
Imagine there's no clutter, no messy code to see,
No tangled lines to fix, just pure simplicity.
Imagine all the spaces, just erased with a tap,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Verse 2)
Imagine there's no tabs, only indents in our code,
No more endless debates, over style choices bestowed.
Imagine all the programmers, working hand in hand,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Bridge)
You may say I'm obsessed, with formatting rules so strict,
But I believe in consistency, it's a programming pick.
I hope someday you'll see, the beauty that it brings,
A world of clean code, where simplicity sings.
(Verse 3)
Imagine no more wasted time, fixing formatting woes,
No more endless scrolling, to find what we suppose.
Imagine all the coders, focusing on what truly matters,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Outro)
Imagine a world of code, where order reigns supreme,
No more tangled spaghetti, just a programmer's dream.
You may say I'm a dreamer, but I'm not the only one,
With the black formatter, we can make it all come undone.
I'm ok with the custom action, but my preference is to embrace the dark side and go black. I don't expect consensus on this and I'm not going to push it today. I just want to use this opportunity to plant a seed in your minds :) See details below for our new AI overlord's vision of a world in black
There are some things that Black doesn't do it seems: e.g., flagging unused variables or imports
Good point Adam. We can use one or more of black, ruff, flake8, isort, pydocstyle, etc. metpy's multi-tool linting workflow looks interesting in part because they're piping the output of the linters into reviewdog. Unidata/MetPy#2967 suggests that their goal is to consolidate most linting into ruff as it gains more features.
I’m curious if anyone investigated just using an off the shelf marketplace action like the ones I linked in this comment before writing custom code in #1786 that we’ll have to maintain?
I looked at the flake8 options in the actions marketplace and felt they don't contribute much toward writing a CI workflow that only lints changed lines. There appear to be two kinds of flake8 actions available on the marketplace. The first kind installs and runs flake8 using any custom arguments we provide, and then captures flake8's output to create annotations on the pull request. The second kind only sets up the tool that captures flake8's output for annotations and requires us to install and run flake8. To use these actions, we need to write a workflow file in this repository that calls them, and it is only a few more lines of code to reimplement their functionality ourselves.
The first kind of action does not support linting changed lines only. The easiest way to lint changed lines is to pipe the output of git diff to flake8 --diff. If the action calls flake8 for us, I don't know how to pipe the git diff output to it. Next, the --diff option was removed in flake8 v6, so we would need to be able to control the version of flake8 that the action uses.
The second kind of action does so little that reimplementing its functionality is more maintainable. All the implementation details are in one place. The implementation is writing a JSON file that defines how flake8's output should be mapped to annotations and then registering this JSON file with the CI workflow.
Activity
mikofski commentedon May 3, 2023
Pycodestyle returns line item results we could pipe that to an artifact. No preference between this and flake8
i also notice there are many GitHub actions for python code style checking. IDK if any will offer the same level of feedback, but maybe?
kandersolar commentedon May 4, 2023
Well I see it's running on other PRs now. Not sure why it's not running on #1395. Anyway I guess we don't have to replace it immediately.
adriesse commentedon May 5, 2023
Yay, no more annoying stickler error messages!! :)
wholmgren commentedon Jun 27, 2023
I'm ok with the custom action, but my preference is to embrace the dark side and go black. I don't expect consensus on this and I'm not going to push it today. I just want to use this opportunity to plant a seed in your minds :) See details below for our new AI overlord's vision of a world in black
Details
(Verse 1)
Imagine there's no clutter, no messy code to see,
No tangled lines to fix, just pure simplicity.
Imagine all the spaces, just erased with a tap,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Verse 2)
Imagine there's no tabs, only indents in our code,
No more endless debates, over style choices bestowed.
Imagine all the programmers, working hand in hand,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Bridge)
You may say I'm obsessed, with formatting rules so strict,
But I believe in consistency, it's a programming pick.
I hope someday you'll see, the beauty that it brings,
A world of clean code, where simplicity sings.
(Verse 3)
Imagine no more wasted time, fixing formatting woes,
No more endless scrolling, to find what we suppose.
Imagine all the coders, focusing on what truly matters,
You may say I'm a dreamer, but I'm not the only one.
(Chorus)
I hope someday you'll join us,
And the world will be bug-free,
With the black formatter, it's easy,
To code in harmony.
(Outro)
Imagine a world of code, where order reigns supreme,
No more tangled spaghetti, just a programmer's dream.
You may say I'm a dreamer, but I'm not the only one,
With the black formatter, we can make it all come undone.
AdamRJensen commentedon Jul 1, 2023
There are some things that Black doesn't do it seems: e.g., flagging unused variables or imports
wholmgren commentedon Jul 6, 2023
Good point Adam. We can use one or more of black, ruff, flake8, isort, pydocstyle, etc. metpy's multi-tool linting workflow looks interesting in part because they're piping the output of the linters into reviewdog. Unidata/MetPy#2967 suggests that their goal is to consolidate most linting into ruff as it gains more features.
mikofski commentedon Jul 8, 2023
I’m curious if anyone investigated just using an off the shelf marketplace action like the ones I linked in this comment before writing custom code in #1786 that we’ll have to maintain?
reepoi commentedon Jul 12, 2023
I looked at the flake8 options in the actions marketplace and felt they don't contribute much toward writing a CI workflow that only lints changed lines. There appear to be two kinds of flake8 actions available on the marketplace. The first kind installs and runs flake8 using any custom arguments we provide, and then captures flake8's output to create annotations on the pull request. The second kind only sets up the tool that captures flake8's output for annotations and requires us to install and run flake8. To use these actions, we need to write a workflow file in this repository that calls them, and it is only a few more lines of code to reimplement their functionality ourselves.
The first kind of action does not support linting changed lines only. The easiest way to lint changed lines is to pipe the output of
git difftoflake8 --diff. If the action calls flake8 for us, I don't know how to pipe thegit diffoutput to it. Next, the--diffoption was removed in flake8 v6, so we would need to be able to control the version of flake8 that the action uses.The second kind of action does so little that reimplementing its functionality is more maintainable. All the implementation details are in one place. The implementation is writing a JSON file that defines how flake8's output should be mapped to annotations and then registering this JSON file with the CI workflow.