Arraymancer icon indicating copy to clipboard operation
Arraymancer copied to clipboard

Quiet hints about unused imports, style checks etc.

Open Vindaar opened this issue 1 year ago • 3 comments

Pheew, this was some tedious work.

I added the styles:usages flag to arraymancer's nim.cfg and then went for a hunt for variables / procs etc. that violated our rules of naming. In almost all cases I simply stuck to the name initially used.

Personally I would probably change astype to asType. But given that it's noinit and nodecl instead of noInit and noDecl, I guess astype also makes sense...

I'd appreciate if someone could give some input on this, as I had to touch a big chunk of the code.

One note: for some templates that used a t Tensor argument and a T generic type, the compiler got confused thinking small t referred to type T. So in those cases I changed the argument name to x or arg.

Vindaar avatar Jul 28 '22 16:07 Vindaar

I agree with you on asType and all names that we define in our libraries should be camelCase. The fact that noinit isn't, is not our concern really. I think it's better to keep that kind of style only the the compiler-specific ones because those people are more likely to know about.

HugoGranstrom avatar Jul 28 '22 16:07 HugoGranstrom

asType is fine

mratsim avatar Jul 29 '22 10:07 mratsim

Personally, I think the compiler should change noinit/nodecl to noInit/noDecl and in general do a clean-up - sooner is better than later since people will probably only use style-check more as time goes on.

c-blake avatar Aug 01 '22 09:08 c-blake

@mratsim Considering CI 1.0 and 1.2 have been dropped by commit a59d703d1d4ee6371e9e9c679c711ec02cfea4b0 I think we should be able to merge this

Clonkk avatar Sep 21 '22 08:09 Clonkk