ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Breaking up violations into sub files

Open colin99d opened this issue 2 years ago • 5 comments
trafficstars

Minor formatting issue. But the violations file is like 6000 lines. Should we make a folder called violations, and then have a file for each linter?

colin99d avatar Jan 11 '23 12:01 colin99d

I think @not-my-profile has some opinions on this.

charliermarsh avatar Jan 12 '23 01:01 charliermarsh

I agree that violations.rs should be split up. In particular I think the violation structs/impls should be defined next to the respective rule implementations (so e.g. LineTooLong next to the line_too_long function). However before we start splitting up violations.rs I'd like to do the following first:

  1. #1816
  2. #1547

After that I'd also like to split up the rules.rs files where it makes sense ... I think we could split up violations.rs at the same time.

not-my-profile avatar Jan 12 '23 14:01 not-my-profile

Since the larger refactors I wanted to do first have been done, I have just opened the PR #1909 to kick off our larger refactoring effort that among other things entails the splitting up of violations.rs.

I'll still have to improve our ConfigurationOptions proc macro so that we can also split up the Options structs though.

not-my-profile avatar Jan 16 '23 08:01 not-my-profile

Should we keep this open, or close out now that the first PR in the effort has been merged? I don't expect us to sink resources into a full migration right now. Rather, I'm hoping we establish the preferred pattern, then migrate over time.

charliermarsh avatar Jan 16 '23 17:01 charliermarsh

You can close it if you like. I was just wanting to see if we had plans to refactor it, since it is a little annoying to add to, but if its a lot of work to change then dont worry about it. Also, thanks both of you for all the work on developer experience over the last two weeks. Definitely a much better experience today than it was two weeks ago.

colin99d avatar Jan 16 '23 20:01 colin99d

It looks like a solution to this was created. I will close.

colin99d avatar Feb 03 '23 18:02 colin99d