flix icon indicating copy to clipboard operation
flix copied to clipboard

Import style

Open magnus-madsen opened this issue 1 year ago • 1 comments

We had a chat here and agree on the following style:

  • Imports must be alphabetically sorted.
  • We should not use grouping: one import per line.
  • Minimal renaming: An import should only be renamed if there is a clash. If there is no clash, no rename.
  • Imports should not use semicolons.

magnus-madsen avatar Jun 27 '24 06:06 magnus-madsen

CC @jaschdoc @chanattan As you refactor, you can start to apply this style.

magnus-madsen avatar Jun 27 '24 06:06 magnus-madsen

What about inner classes like Map$Entry? Should we rename these to Entry in the import?

jaschdoc avatar Jul 23 '24 09:07 jaschdoc

The following files must be changed to the new import style:

  • [x] https://github.com/flix/flix/pull/7977/files
  • [x] https://github.com/flix/flix/pull/7980/files
  • [x] https://github.com/flix/flix/pull/7901/files
  • [x] https://github.com/flix/flix/pull/7909/files
  • [x] https://github.com/flix/flix/pull/7953/files

jaschdoc avatar Jul 25 '24 16:07 jaschdoc

What about inner classes like Map$Entry? Should we rename these to Entry in the import?

I suppose so. @mlutze Thoughts?

magnus-madsen avatar Jul 27 '24 13:07 magnus-madsen

What about inner classes like Map$Entry? Should we rename these to Entry in the import?

I suppose so. @mlutze Thoughts?

I agree

mlutze avatar Jul 27 '24 14:07 mlutze