Skip to content

Commit 3418408

Browse files
authored
Merge pull request #170 from olafurpg/docs
Update docs and clean up issue tracker
2 parents db61523 + 3f2f73b commit 3418408

File tree

12 files changed

+384
-385
lines changed

12 files changed

+384
-385
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scalafix
22
[![Latest version](https://index.scala-lang.org/scalacenter/scalafix/scalafix-core/latest.svg)](https://index.scala-lang.org/scalacenter/scalafix/scalafix-core)
3-
[![Build Status](https://platform-ci.scala-lang.org/api/badges/scalacenter/scalafix/status.svg)](https://platform-ci.scala-lang.org/scalacenter/scalafix)
4-
[![Join the chat at https://gitter.im/scalacenter/scalafix](https://badges.gitter.im/scalacenter/scalafix.svg)](https://gitter.im/scalacenter/scalafix?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3+
[![Build Status](https://travis-ci.org/scalacenter/scalafix.svg?branch=master)](https://travis-ci.org/scalacenter/scalafix)
4+
[![Join the chat at https://gitter.im/scalacenter/scalafix](https://badges.gitter.im/scalacenter/scalafix.svg)](https://gitter.im/scalacenter/scalafix)
55
========
66

77
Rewrite tool to prepare Scala 2.x code for [Dotty](http://dotty.epfl.ch).

build.sbt

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -336,38 +336,6 @@ lazy val readme = scalatex
336336
)
337337
.dependsOn(core, cli)
338338

339-
// Injects necessary paths into system properties to build a scalac global in tests.
340-
def exposePaths(projectName: String,
341-
config: Configuration): Seq[Def.Setting[_]] = {
342-
def uncapitalize(s: String) =
343-
if (s.length == 0) ""
344-
else {
345-
val chars = s.toCharArray; chars(0) = chars(0).toLower; new String(chars)
346-
}
347-
val prefix = "sbt.paths." + projectName + "." + uncapitalize(config.name) + "."
348-
Seq(
349-
sourceDirectory in config := {
350-
val defaultValue = (sourceDirectory in config).value
351-
System.setProperty(prefix + "sources", defaultValue.getAbsolutePath)
352-
defaultValue
353-
},
354-
resourceDirectory in config := {
355-
val defaultValue = (resourceDirectory in config).value
356-
System.setProperty(prefix + "resources", defaultValue.getAbsolutePath)
357-
defaultValue
358-
},
359-
fullClasspath in config := {
360-
val defaultValue = (fullClasspath in config).value
361-
val classpath = defaultValue.files.map(_.getAbsolutePath)
362-
val scalaLibrary = classpath.find(_.contains("scala-library")).get
363-
System.setProperty("sbt.paths.scalalibrary.classes", scalaLibrary)
364-
System.setProperty(prefix + "classes",
365-
classpath.mkString(java.io.File.pathSeparator))
366-
defaultValue
367-
}
368-
)
369-
}
370-
371339
lazy val isFullCrossVersion = Seq(
372340
crossVersion := CrossVersion.full
373341
)

readme/Changelog.scalatex

Lines changed: 2 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -3,144 +3,5 @@
33
@import scalafix.Versions
44

55
@sect{Changelog}
6-
@sect{0.3.4}
7-
@ul
8-
@li
9-
New @code{RenameSymbol} tree patch, which behaves similar to "Rename
10-
method/variable" refactorings in IDEs.
11-
@li
12-
New module: @sect.ref{scalafix-testkit}.
13-
@li
14-
Rewrites can now report info/warn/error messages via
15-
@code{ctx.reporter.info/warn/error}, see @pr(118).
16-
@li
17-
2.11 support is now only for 2.11.10.
18-
@sect{0.3.3}
19-
@ul
20-
@li
21-
NOTE.
22-
scalafix-core and scalafix-cli are now published as
23-
@code{CrossVersion.full}, meaning the artifact IDs now have a @code("_" +
24-
Versions.scalaVersion) suffix. To depend on them,
25-
@hl.scala
26-
// OK
27-
libraryDependencies +=
28-
"ch.epfl.scala" % "scalafix-core" % "@scalafix.Versions.version" cross CrossVersion.full
29-
// Error
30-
libraryDependencies +=
31-
"ch.epfl.scala" %% "scalafix-core" % "@scalafix.Versions.version"
32-
@li
33-
NOTE.
34-
This version depends on a pre-release of scala.meta, which is publised
35-
to the scalameta bintray repository and requires
36-
@hl.scala
37-
resolvers += Resolver.bintrayRepo("scalameta", "maven")
38-
@li
39-
scalafix-cli new supports running semantic rewrites with the
40-
@code{--classpath/--sourcepath} options.
41-
@li
42-
scalafix-cli now supports @code{.sbt} files.
43-
@li
44-
New documentation for @sect.ref{scalafix-cli}.
45-
@sect{0.3.2}
46-
See @lnk("merged PRs", "https://github.com/scalacenter/scalafix/milestone/2?closed=1").
47-
@ul
48-
@li
49-
It is possible to load custom rewrites from source with
50-
@code{rewrites = ["file:MyRewrite.scala"]} or urls
51-
@code{rewrites = ["https://gist./../.Rewrite.scala"]}.
52-
See @sect.ref{Custom rewrites} for more info.
53-
@li
54-
@code{imports.groups = []} can now be empty, thank you @user{mlangc}
55-
for contributing this fix!
56-
@li
57-
Named imports are no longer subsumed by wildcard imports, which could
58-
previously introduce ambiguous imports.
59-
@li
60-
@code{imports.expandRelative = false} by default.
61-
Expanded relative imports can create unused imports.
62-
If you want to expand relative imports, you may need to run scalafix twice
63-
to remove unused imports created by scalafix.
64-
@li
65-
Fixed minor ordering bugs in organize imports.
66-
@sect{0.3.1}
67-
@ul
68-
@li
69-
Fixed a bug in organize imports when there was no import in the
70-
original source file.
71-
@li
72-
Patch.apply and OrganizeImports no longer accept a redundant @code{tree: Tree} argument, the
73-
@code{ctx} already contains the tree.
74-
@li
75-
Xor2Either is disabled by default now, it was enabled by default
76-
causing the @code{scalafix} command to slow down significantly.
77-
Rewrites using @code{scala.meta.Mirror} should not experience a
78-
slowdown.
79-
@li
80-
Added new @code{Rename(from: Name, to: Name)} tree patch that's
81-
accesible via the scalafix-library.
82-
@sect{0.3.0}
83-
@ul
84-
@li
85-
Scalafix now uses the scala.meta semantic API!
86-
See @lnk("scala.meta 1.6 release notes",
87-
"https://github.com/scalameta/scalameta/blob/master/changelog/1.6.0.md#semantic-api")
88-
for more details about the semantic api.
89-
This first release of the scala.meta semantic API enables rewrites to query for the "symbol"
90-
of a name that appears in a Scala source file.
91-
A symbol is a unique identifier of a definition such as a class, val, def or trait.
92-
@li
93-
To demonstrate the capabilities of rewrites using the scala.meta semantic API,
94-
we have included an example rewrite called @lnk(
95-
"Xor2Either",
96-
"https://github.com/scalacenter/scalafix/blob/master/core/src/main/scala/scalafix/rewrite/Xor2Either.scala"
97-
).
98-
The rewrite migrates usage of @code{cats.data.Xor} to @code{scala.util.Either}.
99-
@li
100-
Rewrites can now be implemented in terms of "tree patches", which are high
101-
level descriptions of common refactoring operations.
102-
Tree patches can be composed to build more advanced refactorings
103-
such as @code{Xor2Either}.
104-
The current available tree patches are
105-
@ul
106-
@li
107-
@code{Replace}: Replaces usage of a symbol with another name.
108-
@li
109-
@code{AddGlobalImport}: Adds a top-level import to source file.
110-
@li
111-
@code{RemoveGlobalImport}: Removes a top-level import from source file.
112-
@p
113-
Special thanks go to @user{ShaneDelmore} for helping out try the
114-
scalafix patch API at every step of its development. His feedback has
115-
been invaluable in improving the design of the API.
116-
@li
117-
Configuration in .scalafix.conf has been greatly improved to support a wide range
118-
of options.
119-
Examples, see @sect.ref{patches}, @code{imports} (now removed) and @sect.ref{All options}.
120-
@sect{0.2.1}
121-
@ul
122-
@li
123-
@code{sbt scalafix} runs @code{ExplicitImplicit} and @code{ProcedureSyntax}
124-
by default when there is no @code{.scalafix.conf}.
125-
@li
126-
Upgraded scala.meta dependency to fix parsing + pretty-printer bugs.
127-
@sect{0.2.0}
128-
@ul
129-
@li
130-
First semantic rewrite! See @sect.ref{ExplicitReturnTypes}.
131-
@li
132-
Removed command line interface in favor of compiler plugin.
133-
Why? To run semantic rewrites, scalafix needs to compile source files.
134-
The scalafix command line tool has no aspiration to become a build tool.
135-
@sect{0.1.0}
136-
@ul
137-
@li
138-
New command line tool: @code{scalafix}.
139-
(EDIT: superseded by scalafix-nsc compiler plugin in v0.2)
140-
@li
141-
New SBT plugin: @code{sbt-scalafix}. See @sect.ref{sbt-scalafix}.
142-
@li
143-
Two rewrite rules:
144-
@sect.ref{ProcedureSyntax}
145-
and
146-
@sect.ref{VolatileLazyVal}.
6+
@scalatex.Changelog04()
7+
@scalatex.Changelog03()

readme/Changelog03.scalatex

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
@import Main._
2+
@import scalafix.Readme._
3+
@import scalafix.Versions
4+
5+
@sect{0.3.4}
6+
@ul
7+
@li
8+
New @code{RenameSymbol} tree patch, which behaves similar to "Rename
9+
method/variable" refactorings in IDEs.
10+
@li
11+
New module: @sect.ref{scalafix-testkit}.
12+
@li
13+
Rewrites can now report info/warn/error messages via
14+
@code{ctx.reporter.info/warn/error}, see @pr(118).
15+
@li
16+
2.11 support is now only for 2.11.10.
17+
@sect{0.3.3}
18+
@ul
19+
@li
20+
NOTE.
21+
scalafix-core and scalafix-cli are now published as
22+
@code{CrossVersion.full}, meaning the artifact IDs now have a @code("_" +
23+
Versions.scalaVersion) suffix. To depend on them,
24+
@hl.scala
25+
// OK
26+
libraryDependencies +=
27+
"ch.epfl.scala" % "scalafix-core" % "@scalafix.Versions.version" cross CrossVersion.full
28+
// Error
29+
libraryDependencies +=
30+
"ch.epfl.scala" %% "scalafix-core" % "@scalafix.Versions.version"
31+
@li
32+
NOTE.
33+
This version depends on a pre-release of scala.meta, which is publised
34+
to the scalameta bintray repository and requires
35+
@hl.scala
36+
resolvers += Resolver.bintrayRepo("scalameta", "maven")
37+
@li
38+
scalafix-cli new supports running semantic rewrites with the
39+
@code{--classpath/--sourcepath} options.
40+
@li
41+
scalafix-cli now supports @code{.sbt} files.
42+
@li
43+
New documentation for @sect.ref{scalafix-cli}.
44+
@sect{0.3.2}
45+
See @lnk("merged PRs", "https://github.com/scalacenter/scalafix/milestone/2?closed=1").
46+
@ul
47+
@li
48+
It is possible to load custom rewrites from source with
49+
@code{rewrites = ["file:MyRewrite.scala"]} or urls
50+
@code{rewrites = ["https://gist./../.Rewrite.scala"]}.
51+
See @sect.ref{Custom rewrites} for more info.
52+
@li
53+
@code{imports.groups = []} can now be empty, thank you @user{mlangc}
54+
for contributing this fix!
55+
@li
56+
Named imports are no longer subsumed by wildcard imports, which could
57+
previously introduce ambiguous imports.
58+
@li
59+
@code{imports.expandRelative = false} by default.
60+
Expanded relative imports can create unused imports.
61+
If you want to expand relative imports, you may need to run scalafix twice
62+
to remove unused imports created by scalafix.
63+
@li
64+
Fixed minor ordering bugs in organize imports.
65+
@sect{0.3.1}
66+
@ul
67+
@li
68+
Fixed a bug in organize imports when there was no import in the
69+
original source file.
70+
@li
71+
Patch.apply and OrganizeImports no longer accept a redundant @code{tree: Tree} argument, the
72+
@code{ctx} already contains the tree.
73+
@li
74+
Xor2Either is disabled by default now, it was enabled by default
75+
causing the @code{scalafix} command to slow down significantly.
76+
Rewrites using @code{scala.meta.Mirror} should not experience a
77+
slowdown.
78+
@li
79+
Added new @code{Rename(from: Name, to: Name)} tree patch that's
80+
accesible via the scalafix-library.
81+
@sect{0.3.0}
82+
@ul
83+
@li
84+
Scalafix now uses the scala.meta semantic API!
85+
See @lnk("scala.meta 1.6 release notes",
86+
"https://github.com/scalameta/scalameta/blob/master/changelog/1.6.0.md#semantic-api")
87+
for more details about the semantic api.
88+
This first release of the scala.meta semantic API enables rewrites to query for the "symbol"
89+
of a name that appears in a Scala source file.
90+
A symbol is a unique identifier of a definition such as a class, val, def or trait.
91+
@li
92+
To demonstrate the capabilities of rewrites using the scala.meta semantic API,
93+
we have included an example rewrite called @lnk(
94+
"Xor2Either",
95+
"https://github.com/scalacenter/scalafix/blob/master/core/src/main/scala/scalafix/rewrite/Xor2Either.scala"
96+
).
97+
The rewrite migrates usage of @code{cats.data.Xor} to @code{scala.util.Either}.
98+
@li
99+
Rewrites can now be implemented in terms of "tree patches", which are high
100+
level descriptions of common refactoring operations.
101+
Tree patches can be composed to build more advanced refactorings
102+
such as @code{Xor2Either}.
103+
The current available tree patches are
104+
@ul
105+
@li
106+
@code{Replace}: Replaces usage of a symbol with another name.
107+
@li
108+
@code{AddGlobalImport}: Adds a top-level import to source file.
109+
@li
110+
@code{RemoveGlobalImport}: Removes a top-level import from source file.
111+
@p
112+
Special thanks go to @user{ShaneDelmore} for helping out try the
113+
scalafix patch API at every step of its development. His feedback has
114+
been invaluable in improving the design of the API.
115+
@li
116+
Configuration in .scalafix.conf has been greatly improved to support a wide range
117+
of options.
118+
Examples, see @sect.ref{patches}, @code{imports} (now removed) and @sect.ref{All options}.
119+
@sect{0.2.1}
120+
@ul
121+
@li
122+
@code{sbt scalafix} runs @code{ExplicitImplicit} and @code{ProcedureSyntax}
123+
by default when there is no @code{.scalafix.conf}.
124+
@li
125+
Upgraded scala.meta dependency to fix parsing + pretty-printer bugs.
126+
@sect{0.2.0}
127+
@ul
128+
@li
129+
First semantic rewrite! See @sect.ref{ExplicitReturnTypes}.
130+
@li
131+
Removed command line interface in favor of compiler plugin.
132+
Why? To run semantic rewrites, scalafix needs to compile source files.
133+
The scalafix command line tool has no aspiration to become a build tool.
134+
@sect{0.1.0}
135+
@ul
136+
@li
137+
New command line tool: @code{scalafix}.
138+
(EDIT: superseded by scalafix-nsc compiler plugin in v0.2)
139+
@li
140+
New SBT plugin: @code{sbt-scalafix}. See @sect.ref{sbt-scalafix}.
141+
@li
142+
Two rewrite rules:
143+
@sect.ref{ProcedureSyntax}
144+
and
145+
@sect.ref{VolatileLazyVal}.

0 commit comments

Comments
 (0)