reflex
reflex copied to clipboard
ruff-format: unify Black with Ruff `v0.1`
All Submissions:
- [x] Have you followed the guidelines stated in CONTRIBUTING.md file?
- [x] Have you checked to ensure there aren't any other open Pull Requests for the desired changed?
Type of change
As Ruff lint is already used I would suggest using also ruff-format for better consistency between lint and formatted
fixes #2928
well while the Black was back from 2022, it seems the diff is quite large...
@Borda seems most of the large diff is adding a blank line after the final Returns: - is there a way to disable that? Then it may be much smaller
most of the large diff is adding a blank line after the final
Returns:- is there a way to disable that? Then it may be much smaller
I found that these changes would be skipped case-by-case, but that would help with diff size at all :( ref: https://docs.astral.sh/ruff/formatter/#format-suppression
@picklelo and the formating evolves over time, and the actual version of Ruff is before 0.1, so a fine middle ground would be just update to Ruff 0.1 with enabled formatting, and if you agree do smaller steps by updating to 0.2 and 0.3 in separate/consecutive/incremental PRs
@Borda yes we should update to the latest version of ruff I didn't realize we were so out of date. Is there a huge change if we go to 0.3 of ruff now? If the diff is manageable I'm for upgrading to that. Otherwise, we can do the incremental approach as you suggested.
Is there a huge change if we go to 0.3 of ruff now?
I do not think in ruff lint but as you saw some patterns changed in Black/Ruff formating if pre-commit as bot is enabled it has also a feature to update its version monthly via PR
looking to the pyright and not sure how to read the issues, what to fix...
looking to the pyright and not sure how to read the issues, what to fix...
i would assume it's because the formatter moved important # type: ignore comments to the wrong place and thus they stopped applying to the line they were meant to apply to
it seems this also would need to be updated:
https://github.com/reflex-dev/reflex/blob/036afa951a5700b04722a0bcd7d3143dde07a12a/scripts/pyi_generator.py#L19-L20
Or is it fine to drop formatting for the pyi as they seem to be generated anyway?
Yeah less concerned about formatting the pyi files we can add that in later if needed.
We could drop the formatting of .pyi files but we have to make sure that the output of the script is deterministic, to avoid false positive when detecting is pyi were updated.
Can we sync this PR on main again since there is quite a few conflicts?
Can we sync this PR on main again since there is quite a few conflicts?
@Lendemor, merged with accepting all from main and re-run precommit... :flamingo:
Can we sync this PR on main again since there is quite a few conflicts?
@Lendemor, merged with accepting all from
mainand re-run precommit... π¦©
I think you still need to remove some changes to pyi files, that's why the pre-commit check is failing.
@picklelo @Lendemor mind check it now, pls :flamingo:
@picklelo @Lendemor mind check it now, pls π¦©
I've reran the CI, it seems like some of the # type: ignore pragma have been moved by the formatting, so they are not on the line they should be, so pyright fail.
PR should be ready for merge, but it seems like github changed stuff about the available macos worker, we'll need to fix it first π
PR should be ready for merge
Thank you for your help and patience! π
but it seems like github changed stuff about the available macos worker, we'll need to fix it first π
You just need to pin mac-13 Seems like GH swap mac14 from beta to latest...
We've merged a fix for macos CI, one last sync with main and we should be good to go. π
@Lendemor merged with main :flamingo: