raincoat icon indicating copy to clipboard operation
raincoat copied to clipboard

What about a config file?

Open twidi opened this issue 8 years ago • 4 comments

I love the idea and tend to use raincoat in my recent work.

But sometimes the raincoat comment does not have any good place in the source code.

First, it is often too long (my last one is 136 chars).

Second, you force it to be in a .py file.

But for example, for prospector, I forked the lib with a new package on pypi, and in my documentation, I say to use this package. But there is no relevant .py file in my project where to put this.

So I had to create a raincoat_prospector.py file for this only reason, with simply a comment!

Yes, it may not be "wrong" to have a "raincoat.py" file in the project with all the needed comments.

But maybe a raincoat.cfg (or a [tools:raincoat] section in setup.cfg could be the good way to handle this kind of thing?

twidi avatar Oct 20 '17 10:10 twidi

Hello, First, thanks for using this software :) It's still in early stage so I believe you're bound to find ways to improve the UX, and this issue is the living proof of that.

You're right about the line length. I've been trying to think about a good way to split it into several lines when needed, but I haven't found a convincing way yet, given I'm matching a regex. Given how complex it's getting, I think that if I want to make this any more complex, I'd better call grep from my code directly (but that woudn't be nice to non-unix users). I'm open to suggestions :)

You're also completely right for the .py limitation. It's only because of this line and it has actually no reason to be, but if we removed this line, you'd still have to create a file with comments in it, which is not really interesting given we could have this, as you state, in a proper config file (and we wouldn't have the grep issue anymore)

Thirdly, you made me realize I'm missing a usecase : finding changes in a whole package, not just a module. That should totally be a thing :)

Conclusion: You're absolutely right and I'll be delighted to remove these pain points quickly, we just need to find the best way to do so.

ewjoachim avatar Oct 20 '17 16:10 ewjoachim

Note that limiting to .py in the current way of searching is actually a good thing. Do you imagine scanning every single file on a repository? I don't think it's a good idea :)

twidi avatar Oct 20 '17 16:10 twidi

But shouldn’t that be configurable ? What if you port a python function into a js lib and you want to use raincoat to know if the original python function is modified ?

ewjoachim avatar Oct 20 '17 20:10 ewjoachim

I'm just saying that, actually, it's a good thing to limit, especially because it's not configurable :)

twidi avatar Oct 20 '17 20:10 twidi