Releases: scalameta/scalafmt
Releases Β· scalameta/scalafmt
v3.9.1
Features
- ScalafmtRunner: allow dedicated format thread pool (#4840) @kitbellew
- TermDisplay: track each stage: read, format, write (#4837) @kitbellew
- TermDisplay: use the same format in fallback (#4838) @kitbellew
- TermDisplay: simplify, remove url stuff (#4835) @kitbellew
Bug fixes
- Async processing:
- Cli: ensure input execution context is initialized (#4834) @kitbellew
- ScalafmtRunner: don't stop on first failure (#4833) @kitbellew
- Cli: do not forget to exit on failure as well (#4830) @kitbellew
- GranularPlatformAsyncOps: modify read/write async (#4829) @kitbellew
- ScalafmtRunner: use separate execution contexts (#4824) @kitbellew
- RegexCompat: keep multiline-string trailing spaces (#4836) @kitbellew
- bugfix: Don't use aggregate in Scala Native (#4823) @tgodzik
Miscellaneous
- PathMatcher: move to sysops, for sbt-scalafmt (#4843) @kitbellew
- RunnerSettings: rename from ScalafmtRunner (#4842) @kitbellew
- InputMethod: handle misformatted file, don't throw (#4831) @kitbellew
- Error: remove unused classes or ctors (#4828) @kitbellew
Build and dependency updates
- Scalameta: upgrade to v4.13.2 (#4841) @kitbellew
- Workflow: revise how we continue on error (#4844) @kitbellew
- Workflow: skip test step error detection until end (#4839) @kitbellew
- CI: test all platforms, separate into steps (#4832) @kitbellew
v3.9.0
Features
Introduces support for Scala.js, includes some re-design for consistent cross-platform behaviour, such as asynchronous processing (I/O, Futures) etc.
- PlatformFileOps: read/write files asynchronously (#4822) @kitbellew
- SBT: add JSPlatform to cli (#4816) @kitbellew
- SBT: add JSPlatform to tests (#4817) @kitbellew
- SBT: add JSPlatform to core (#4815) @kitbellew
- SBT: add JSPlatform to config (#4814) @kitbellew
- SBT: add JSPlatform to sysops (#4812) @kitbellew
- ScalafmtRunner, InputMethod: run asynchronously (#4809) @kitbellew
- Use PlatformFileOps instead of nio Files (#4808) @kitbellew
- Use platform-agnostic exception classes (#4807) @kitbellew
- PlatformRunOps: define exit() instead of sys.exit (#4805) @kitbellew
- TermDisplay: use platform-agnostic polling (#4804) @kitbellew
- SBT: add JSPlatform to macros (#4801) @kitbellew
- sysops: refactor platform-specific code (#4800) @kitbellew
- interfaces: add JSPlatform implementation (#4799) @kitbellew
- FormatWriter: don't use Patern.splitAsIterator (#4792) @kitbellew
- FileOps: keep only readFile(Path) (#4790) @kitbellew
- PlatformCompat: inline
prepareCommand
(#4787) @kitbellew - PlatformCompat: inline
fixPathOnNativeWindows
(#4786) @kitbellew - PlatformCompat: inline
relativize
(#4785) @kitbellew - PlatformCompat: remove
()
inisNativeOnWindows
(#4784) @kitbellew - OsSpecific: remove implicits, use methods directly (#4756) @kitbellew
- ScalafmtRunner: use Future, not
.par
(#4743) @kitbellew - CommunitySuite: use Future instead of
.par
(#4747) @kitbellew - ScalafmtCliReporter: refactor error, exit handling (#4745) @kitbellew
Bug fixes
- Router: use only possible split if
( comment NL
(#4782) @kitbellew - RedundantBraces: fix removing blocks (#4783) @kitbellew
- Consistent formatting on Unix and Windows
- FormatTests: always test windows lineEndings, too (#4781) @kitbellew
- RegexCompat: fix docstring patterns for
\r
(#4777) @kitbellew - FormatWriter: revise SLC formatting (#4779) @kitbellew
- State: expand space check to include non-breaking (#4780) @kitbellew
- FormatWriter: define string slice append method (#4778) @kitbellew
- RegexCompat: fix leading-asterisk pattern for
\r
(#4776) @kitbellew - RegexCompat: revise splitByBeforeTextMatching (#4775) @kitbellew
- RegexCompat: fix comment patterns for
\r
(#4774) @kitbellew - RegexCompat: fix strip margin patterns for
\r
(#4773) @kitbellew - RegexCompat: remove unused patterns (#4772) @kitbellew
- RegexCompat[native]: add method to compile pattern (#4771) @kitbellew
- Markdown: handle LineEndings.windows correctly (#4768) @kitbellew
- Imports: handle LineEndings.windows correctly (#4770) @kitbellew
- State: exclude trailing space/CR from column width (#4769) @kitbellew
- Add tests with line under/overflow for strings (#4767) @kitbellew
- RegexCompat: no need to inline
vals
(#4766) @kitbellew
Miscellaneous
- Configuration: document how imports sorting works (#4796) @kitbellew
- FileOps: inline getFileMatcher in dynamic (#4794) @kitbellew
- FileOps: remove unused methods (#4793) @kitbellew
- FormatAssertions: use StringBuilder explicitly (#4791) @kitbellew
- FormatTests: use DiffOptions to avoid ANSI (#4765) @kitbellew
- CliTest: use munit.Location, assertContains (#4746) @kitbellew
Build and dependency updates
- Scalameta: upgrade to v4.13.1 (#4821) @kitbellew
- Update jline to 3.29.0 (#4819) @scalameta-bot
- Update sbt-native-packager to 1.11.1 (#4818) @scalameta-bot
- Upgrade metaconfig to v0.15.0, mdoc to v2.6.4 (#4813) @kitbellew
- Scalameta: upgrade to v4.13.0 (#4811) @kitbellew
- Coursier: upgrade to 2.1.24, interfaces to 1.0.28 (#4806) @kitbellew
- SBT: cosmetic, refactor scalameta dependencies (#4798) @kitbellew
- SBT: add methods to check if scala 2.12 or 2.13 (#4797) @kitbellew
- Use parallel-collections in 2.13 scala native (#4789) @jchyb
- mdoc: upgrade to v2.6.3 (#4788) @kitbellew
- CI: enable
dockerize
on release (#4762) @kitbellew - CI: run
scala-native
only on release (#4763) @kitbellew - fix: Add back removed script to allow scalafmt action to work (#4760) @tgodzik
- Cli: use varargs, remove unused methods (#4757) @kitbellew
- SBT: build community tests for JVM and Native (#4748) @kitbellew
- refactor: Use Scala Native instead of native image (#4738) @tgodzik
- Update sbt-scalafmt to 2.5.4 (#4754) @scalameta-bot
- Update scala-parallel-collections to 1.2.0 (#4753) @scalameta-bot
- Update sbt-scalajs to 1.18.2 (#4752) @scalameta-bot
- Update interface to 1.0.27 (#4751) @scalameta-bot
- Update sbt-native-packager to 1.11.0 (#4750) @scalameta-bot
- Update sbt-assembly to 2.3.1 (#4749) @scalameta-bot
- Workflow: add native tests to jvm as a matrix (#4742) @kitbellew
- SBT: refactor tests, move those for cli and sysops (#4740) @kitbellew
- SBT: don't build dynamic for NativePlatform (#4741) @kitbellew
- SBT: refactor tests, move those for cli and sysops (#4739) @kitbellew
- Formatting: upgrade to v3.8.6 (#4737) @kitbellew
v3.8.6
Features
- Spaces: add new IfMultipleContextBounds label (#4726) @kitbellew
Bug fixes
- RedundantBraces: check comment in scala3 ArgClause (#4733) @kitbellew
- RedundantBraces: not every Ident continues Infix (#4732) @kitbellew
- Router: handle braces around context bounds (#4727) @kitbellew
- Format strings and interpolated strings consistently (#4725) @kitbellew
Miscellaneous
- Formatting: update version to v3.8.5 (#4724) @kitbellew
Build and dependency updates
- Scalameta: upgrade to v4.12.7 (#4736) @kitbellew
- Munit: upgrade to v1.1.0 (#4734) @kitbellew
v3.8.5
Bug fixes
- Router: break before
=>
in new given (#4722) @kitbellew - ScalafmtConfig: rename continuationIndent->indent (#4723) @kitbellew
- improvement: Add flags to release for JDK 8 (#4719) @tgodzik
- Scalameta: upgrade to v4.12.6 (#4721) @kitbellew
- contains a fixed scaladoc parser
v3.8.4
Includes release candidates:
Features
- Newlines: split
afterInfix
intoinfix.{term,type,pat}Site
(#4710) @kitbellew - NamedDialect: add
scala36
as a supported version (#4702) @kitbellew
Bug fixes
- Router: handle comments around implicit in clause (#4711) @kitbellew
- FormatOps:
{
of refined type is optimal for defn (#4707) @kitbellew
Miscellaneous
- Newlines: add a shortcut to check for
classic
(#4709) @kitbellew - ScalafmtConfig: remove unnecessary validity check (#4708) @kitbellew
- Documentation: revise
newlines.selectChains
(#4703) @kitbellew - Documentation: fix
redundantBraces.oneStatApply
(#4701) @kitbellew - git blame: ignore scalafmt reformat commits (#4700) @kitbellew
- Formatting: use
redundantBraces.oneStatApply
(#4699) @kitbellew - Formatting: upgrade to v3.8.4-RC4 (#4698) @kitbellew
Build and dependency updates
- Scalameta: upgrade to v4.12.4.1 (#4715) @kitbellew
- Workflow: run CI only native-image upon release (#4697) @kitbellew
v3.8.4-RC4
Features
- FormatOps: use
exemptScope = notAssign
(#4696) @kitbellew - ScalafmtConfig: make format-on/off configurable (#4679) @kitbellew
- Router: add rules for new
given
syntax (#4656) @kitbellew - Config: add
configStyle.bracket{Call,Defn}Site
(#4627) @kitbellew
Configuration changes
With recent changes to metaconfig, some parameters or sections in configuration have been moved:
- OptIn: move annotation params to Newlines (#4686) @kitbellew
- ScalafmtConfig: combine all selectChains params (#4684) @kitbellew
- Newlines: move poorMansTrailingCommasInConfigStyle (#4685) @kitbellew
- ScalafmtConfig: move importSelectors to
binPack
(#4683) @kitbellew - ScalafmtConfig: more
rewriteTokens
torewrite
(#4682) @kitbellew - ScalafmtConfig: move indent params to
.indent.
(#4681) @kitbellew - Config: use SectionRename for renamed sections (#4625) @kitbellew
RedundantBraces improvements
- RedundantBraces: {} or () for any one-stat apply (#4636) @kitbellew
- FormatTokens: ignore additional tokens for span (#4670) @kitbellew
- FormatTokens: add a third way to compute offset (#4668) @kitbellew
- RedundantBraces: improve check around infix (#4677) @kitbellew
- RedundantBraces: remove block within parens (#4669) @kitbellew
- RedundantBraces: remove func body braces in parens (#4667) @kitbellew
- RedundantBraces: replace
(
with{
more often (#4665) @kitbellew - RedundantBraces: remove braces in block in parens (#4664) @kitbellew
- RedundantBraces: remove inner braces in argclause (#4663) @kitbellew
- RedundantBraces: move methods to companion (#4662) @kitbellew
- RedundantBraces: improve check stat OK in parens (#4658) @kitbellew
- RedundantBraces: replace
(
with nested-func{
(#4642) @kitbellew - RedundantBraces: refactor replacing
)
with}
(#4634) @kitbellew - RedundantBraces: remove right if left is removed (#4635) @kitbellew
- RedundantBraces: check
}
removal consistently (#4633) @kitbellew
Policy and BestFirstSearch improvements
- Policy: add methods
asAfter
andasUntil
(#4652) @kitbellew - Policy: add terminal, use in BestFirstSearch (#4661) @kitbellew
- Policy: re-order, group fields consistently (#4660) @kitbellew
- Policy: restore implicit FileLine in Clause (#4659) @kitbellew
- Policy: define
appliesOn
method (#4653) @kitbellew - BestFirstSearch: memorize SLB states separately (#4650) @kitbellew
- Policy: add maxEndPos (#4651) @kitbellew
- Policy: remove Proxy as unused (#4649) @kitbellew
- Policy: extract WithBeforeAfter for Relay, Switch (#4647) @kitbellew
- Policy: extract expire from Clause, use Expire (#4646) @kitbellew
- Policy: remove
Policy.
prefix withinPolicy
(#4644) @kitbellew - Policy: remove implicit FileLine from Relay (#4643) @kitbellew
- Router: remove redundant check in braces-to-parens (#4641) @kitbellew
Bug fixes
- SBT: use a compatible architecture in native image (#4676) @kitbellew
- RewriteTrailingCommas: remove for any close delim (#4675) @kitbellew
- FormatOps: in nested opens, check args in parens (#4673) @kitbellew
- FormatOps: allow blank around infix if in parens (#4671) @kitbellew
- RedundantParens: keep parens in
given
infix type (#4657) @kitbellew - Router: in startsInfix, always check for LHS (#4639) @kitbellew
- FormatOps: strip removed blocks from only arg (#4640) @kitbellew
- OptimizationEntities: clause rewritten w/ braces (#4638) @kitbellew
- Router: strip removed blocks from
onlyArgument
(#4632) @kitbellew - FormatOps: check for removed braces around block (#4631) @kitbellew
- FormatOps: match lambda skipping empty blocks (#4628) @kitbellew
- Router: for/infix before select like fewer-braces (#4618) @kitbellew
Miscellaneous
- FormatOps: simplify logic to skip infix indent (#4695) @kitbellew
- Use .isAny instead of multiple .is (#4688) @kitbellew
- FormatWriter: cosmetic, extract
ltext
(#4680) @kitbellew - CommunityTest: re-enable fold-rewrites in scalajs (#4678) @kitbellew
- RedundantParens: move breakBeforeOp to companion (#4672) @kitbellew
- LoggerOps: in
xxxTree
, default tonoStructure
(#4637) @kitbellew - Router: remove weird case of single enclosed arg (#4629) @kitbellew
- LoggerOps: optionally log without structure (#4630) @kitbellew
- Issue template: direct parsing issues to scalameta (#4622) @kitbellew
- Use wildcard imports for metaconfig (and others) (#4624) @kitbellew
- GitOpsTest: add implicit location, shown with fail (#4607) @kitbellew
- Scalafmt: expand Error.WithCode in external format (#4609) @kitbellew
- Router: refactor handling fewer braces in select (#4617) @kitbellew
Build and dependency updates
- Update munit, munit-diff to 1.0.3 (#4694) @scalameta-bot
- Update sbt, scripted-plugin to 1.10.7 (#4693) @scalameta-bot
- Update scala-parallel-collections to 1.1.0 (#4692) @scalameta-bot
- Update jline to 3.28.0 (#4691) @scalameta-bot
- Update interface to 1.0.26 (#4690) @scalameta-bot
- Update sbt-ci-release to 1.9.2 (#4689) @scalameta-bot
- Scalameta: upgrade to v4.12.3 (#4687) @kitbellew
- Scalameta: upgrade to v4.12.2 (#4655) @kitbellew
- Scalameta: upgrade to v4.12.1 (#4626) @kitbellew
- Upgrade to metaconfig-0.14.0, mdoc-2.6.2 (#4623) @kitbellew
- SBT: get mdoc version from its plugin (#4616) @kitbellew
- SBT: cosmetic, re-group and re-format plugins (#4615) @kitbellew
- Formatting: enable all redundantXxx parameters (#4610) @kitbellew
- Formatting: update version to v3.8.4-RC3 (#4608) @kitbellew
v3.8.4-RC3
Features
- Support pure functions and capture checking (#4582) @kitbellew
- Router: consistent if-else block format for fold (#4581) @kitbellew
- AvoidInfix: process scala3
match
operator, too (#4567) @kitbellew
Fixes
- Router: penalize lambda arrow break further (#4601) @kitbellew
- Router: remove
{
nlPenalty computation (#4606) @kitbellew - FormatOps: extend getSlbEndOnLeft to LeftBrace (#4603) @kitbellew
- FormatOps: support ContextArrow in
getFuncArrow
(#4599) @kitbellew - State: optionally apply indents to alt mod (#4587) @kitbellew
- RedundantParens: enforce infixSide more precisely (#4579) @kitbellew
- TreeOps: a braceless
match
is like fewer-braces (#4577) @kitbellew - FormatTokens: fix getLastExceptParen, incl comment (#4568) @kitbellew
- AvoidInfix: make sure to wrap Term.Match as well (#4566) @kitbellew
Miscellaneous
- Router: optimization, check brace then matching (#4605) @kitbellew
- Policy: add special single-token policy (#4604) @kitbellew
- Router: move to TreeOps getting lambda penalties (#4600) @kitbellew
- Split: add implicit
penalizeNL
andpenalizeIf
(#4598) @kitbellew - PolicyOps: add
exclude
toPenalizeAllNewlines
(#4597) @kitbellew - Indent: add an implicit conversion from Int (#4589) @kitbellew
- Shorten token and ModExt descriptions (#4588) @kitbellew
- Router: refactor select-dot policies (#4586) @kitbellew
- PolicyOps: use Policy.Delay for decideNewlineXxx (#4585) @kitbellew
- FormatOps: extract right delims methods (#4584) @kitbellew
- ModExt: move
alt
centrally from NewlineT (#4583) @kitbellew - Router: remove overlapping match rules (#4580) @kitbellew
- Router: match using FormatToken.{Left,Right}Owner (#4578) @kitbellew
- LoggerOps: log tree name with parent name (#4575) @kitbellew
- DynamicSuite: test Scalafmt interface class loader (#4572) @kitbellew
- AvoidInfix: refactor checkMatchingInfix (#4570) @kitbellew
- Error: add a wrapper Exception
WithCode
(#4565) @kitbellew
Build and dependency updates
- Update sbt, scripted-plugin to 1.10.5 (#4596) @scalameta-bot
- Update auxlib, clib, javalib, nativelib, ... to 0.5.6 (#4595) @scalameta-bot
- Update jline to 3.27.1 (#4593) @scalameta-bot
- Update interface to 1.0.24 (#4592) @scalameta-bot
- Update sbt-buildinfo to 0.13.1 (#4591) @scalameta-bot
- Update
test/resources/readme.md
reference (#4590) @emmanuel-ferdman - Scalameta: upgrade to v4.12.0 (#4576) @kitbellew
- SBT: native-image settings/plugins for JVM only (#4574) @kitbellew
- bugfix: Publish native interfaces with full suffix (#4573) @tgodzik
v3.8.4-RC2
Features
- Performance improvements
- BestFirstSearch: use partially optimal state (#4555) @kitbellew
- BestFirstSearch: move queue isEmpty to dequeue (#4554) @kitbellew
- BestFirstSearch: handle killOnFail in shortestPath (#4553) @kitbellew
- BestFirstSearch: getActiveSplits takes predicate (#4552) @kitbellew
- BestFirstSearch: allow block close go past range (#4541) @kitbellew
- BestFirstSearch: FormatToken index in no-opt zones (#4543) @kitbellew
- FormatTokens: implement
width
with indices (#4551) @kitbellew - BestFirstSearch: recurse on single-case partial functions (#4496) @kitbellew
- BestFirstSearch: skip processOptimal if too long (#4493) @kitbellew
- BestFirstSearch: don't recurse if isOpt (#4491) @kitbellew
- FormatOps: remove redundant infix split (#4465) @kitbellew
- BestFirstSearch: use partially optimal state (#4555) @kitbellew
- FormatOps: implement binPack.parentCtor=ForceBreak (#4550) @kitbellew
- BinPack: use binPack.parentCtors=source explicitly (#4549) @kitbellew
- BinPack.ParentCtors: describe each option in doc (#4548) @kitbellew
- Docstrings:
blankFirstLine=fold
takes precedence (#4534) @kitbellew - AvoidInfix: apply to postfix select as well (#4519) @kitbellew
- RemoveScala3OptionalBraces:
()
to fewer braces (#4515) @kitbellew
Bug fixes
- FormatWriter: 2nd try to fold oneline after format (#4537) @kitbellew
- Fix broken link. (#4547) @counter2015
- Producing non-idempotent formatting
- Router: no break after
=>
in lambda w/ type (#4524) @kitbellew - Router: skip removed block around enclosed expr (#4523) @kitbellew
- Router: zero cost for dot NL in braces-to-parens (#4522) @kitbellew
- Router: skip removed block when traversing (#4521) @kitbellew
- Router: penalize dot NL split if braces-to-parens (#4520) @kitbellew
- FormatOps: adjust block body in CtrlBody.unfolded (#4518) @kitbellew
- PolicyOps: expire SLB exclude On in apply/select (#4517) @kitbellew
- FormatOps: rewrite ArgClause in braces to parens (#4514) @kitbellew
- Router: fold closing paren if no NL after opening (#4513) @kitbellew
- Router: lower NL penalty for braces-to-parens case (#4511) @kitbellew
- Router: refactor lambda splits for
{...
(#4506) @kitbellew - OptimizationEntities: skip block with apply as arg (#4505) @kitbellew
- Router: check exclude blocks if braces to parens (#4502) @kitbellew
- Router: penalize break after
{
in args (#4501) @kitbellew - FormatOps: check deeper if braces can be parens (#4495) @kitbellew
- Policy: compare starts, not ends (#4476) @kitbellew
- Router: force NL if semicolon after removed brace (#4475) @kitbellew
- Router: detect rewritten blocks before
else
(#4473) @kitbellew - State: fix handling of SLC in overflow (#4471) @kitbellew
- FormatOps: inner infixes can be enclosed in braces (#4470) @kitbellew
- Router: align
{...
rule with the one for(...
(#4463) @kitbellew - Router: use SpaceOrNoSplit instead of custom rule (#4462) @kitbellew
- RedundantBraces: revise keeping brace post comment (#4460) @kitbellew
- Router: include brace in optimal only if present (#4459) @kitbellew
- RedundantParens: fold/unfold NL ok before infix op (#4454) @kitbellew
- FormatTokens: check for rewritten empty body (#4452) @kitbellew
- RedundantBraces: keep partial function braces (#4448) @kitbellew
- Router: no break after
- Producing invalid code
- Router: don't fold after single-line comment (#4516) @kitbellew
- Router: force NL after
;
in optional-brace block (#4510) @kitbellew - FormatOps: recognize optional-braces partial func (#4508) @kitbellew
- RedundantBraces: keep braces if splice is
$
(#4509) @kitbellew - FormatTokens: fix token span computation (#4485) @kitbellew
- Router: fold
else
only after non-empty block (#4474) @kitbellew - State: don't delay penalty with pending spaces (#4467) @kitbellew
- Imports: do not expand nor sort import wildcards (#4457) @kitbellew
- Router: add explicit rules for do/while in Term.Do (#4451) @kitbellew
- RedundantBraces: replace paren w/ brace if comment (#4449) @kitbellew
- Router: slightly penalize interpolation newlines (#4442) @kitbellew
- FormatOps: remove noSyntaxNL flag added in #4246 (#4439) @kitbellew
- Router: fix single line end for Mod.Annot (#4438) @kitbellew
- State: fix logic allowing punctuation overflow (#4437) @kitbellew
Miscellaneous
- FormatOps: use new Tokens methods (#4562) @kitbellew
- Router: add ParamClause as well, to Unit/ArgClause (#4560) @kitbellew
- Router: handle Lit.Unit and empty ArgClause (#4556) @kitbellew
- FormatTokens: use FormatToken in matching (#4546) @kitbellew
- Use FormatToken in policies, indents etc. (#4545) @kitbellew
- Debug: log number of times a split was traversed (#4544) @kitbellew
- LoggerOps: add methods to log without position (#4540) @kitbellew
- FormatToken: alias, use everywhere as {FT} (#4539) @kitbellew
- Rewrite: use Map.updateWith (#4538) @kitbellew
- test/JavaDoc: fix test config according to title (#4533) @kitbellew
- Router: cosmetic, clean up beforeCurlyLambdaParams (#4532) @kitbellew
- PolicyOps: use PenalizeAllNewlines if penalty > 0 (#4531) @kitbellew
- SelectLike: use nameFt if possible, vs nameToken (#4529) @kitbellew
- TestStyles: add [un]foldWithRewritesAndOverflow (#4464) @kitbellew
- HasTests: move scalafmtRunner() to companion (#4526) @kitbellew
- Debug: move routes and state logging to LoggerOps (#4527) @kitbellew
- TestHelpers: define helper method to format code (#4525) @kitbellew
- TestStyles: use predefined style variables (#4512) @kitbellew
- Router: use single non-NL default split before
}
(#4499) @kitbellew - Router: inline braces-to-parens policy (#4500) @kitbellew
- TokenRange: use FormatToken instead of Token (#4494) @kitbellew
- BestFirstSearch: turn noOptZones into a Map (#4492) @kitbellew
- Router: break after self-annotation (#4490) @kitbellew
- FormatOps: remove getOptimalTokenFor (#4489) @kitbellew
- BestFirstSearch: use visual token width to recurse (#4488) @kitbellew
- BestFirstSearch: memorize failed search sometimes (#4481) @kitbellew
- Use Token.text instead of Token.syntax (#4487) @kitbellew
- State: move convenience methods checking for SLB (#4486) @kitbellew
- BestFirstSearch: use isOpt, not explicit maxCost (#4484) @kitbellew
- State: refactor getColumns (#4483) @kitbellew
- FormatTests: up visits level to 2000, skip below (#4482) @kitbellew
- FormatOps: stop looking for infixes if check fails (#4469) @kitbellew
- FormatTokens: rename ifEnclosedWithinParens (#4466) @kitbellew
- Add preset values to overflow, redundant delims (#4468) @kitbellew
- Router: refactor around lambda variables (#4461) @kitbellew
- Policy: keep token in Policy.End, not just offset (#4458) @kitbellew
- TestStyles: define implicit style conversions (#4453) @kitbellew
- Do not import deprecated alias scala.meta.Token (#4450) @kitbellew
- RedundantBraces: keep brace after a semicolon (#4446) @kitbellew
- RedundantBraces: cosmetic, minor refactor (#4447) @kitbellew
- FormatTokensRewrite: add ReplacementType.toString (#4445) @kitbellew
- FormatOps: remove duplicate ExtractFromMeta (#4444) @kitbellew
- ScalafmtVersion: relax the regex pattern (#4441) @kitbellew
- CommunitySuite: assert on total number of states (#4443) @kitbellew
- LoggerOps: expand logging (#4440) @kitbellew
Build and dependency updates
- SBT: update native build to recent JDK (#4561) @kitbellew
- SBT: remove buildInfoSettings from macros (#4563) @kitbellew
- Update coursier-interface to 1.0.23 (#4558) @kitbellew
- Scalameta: upgrade to v4.11.2 (#4559) @kitbellew
- CI: run dependabot weekly (#4504) @kitbellew
- CI: switch deprecated macOS-12 to macOS-latest (#4503) @kitbellew
- Update sbt to 1.10.3 (#4480) @scalameta-bot
- Update sbt-scalajs to 1.17.0 (#4479) @scalameta-bot
- Update sbt-ci-release to 1.9.0 (#4478) @scalameta-bot
- Update sbt-assembly to 2.3.0 (#4477) @scalameta-bot
- Scalameta: upgrade to v4.11.0 (#4472) @kitbellew
- use
sbt/setup-sbt
to be suresbt
is present (#4455) @mzuehlke
v3.8.4-RC1
Verifying against public repositories
This release fixes issue #4133 and introduces a large number of fixes which address formatting issues discovered while testing the formatter against a set of public repositories, and adds these checks with every commit.
- CommunitySuite: add Intellij Scala plugin code (#4436) @kitbellew
- CommunitySuite: check the total states visited (#4429) @kitbellew
- CommunitySuite: remove some versions (#4418) @kitbellew
- CommunitySuite: add versions of playframework (#4414) @kitbellew
- CommunitySuite: remove maxStateVisits override (#4390) @kitbellew
- CommunitySuite: add versions of zio (#4407) @kitbellew
- CommunitySuite: allow selecting a subset of styles (#4393) @kitbellew
- CommunitySuite: add versions of Akka (#4391) @kitbellew
- CommunityBuild: add
fileOverride
parameter (#4388) @kitbellew - CommunityBuild:
excluded
as PathMatcher patterns (#4385) @kitbellew - CommunitySuite: add versions of scalaz (#4380) @kitbellew
- CommunitySparkSuite: add spark v3.5.3 (#4378) @kitbellew
- CommunitySuite: set longpaths in clone directory (#4376) @kitbellew
- CommunitySuite: test scala.js version 1.17.0 (#4373) @kitbellew
- CommunitySparkSuite: add more spark versions (#4360) @kitbellew
- CommunitySuite: add tests for spark versions (#4358) @kitbellew
- CommunitySuite: check out projects under target/ (#4348) @kitbellew
- CommunitySuite: add tests for scala-cli versions (#4347) @kitbellew
- CommunityTests: split into separate projects (#4346) @kitbellew
- CommunityRepoSuite: add common abstract superclass (#4345) @kitbellew
- CommunitySuite: print git ref and scalafmt style (#4344) @kitbellew
- CommunitySuite: add tests for scala3 versions (#4342) @kitbellew
- CommunitySuite: add tests for scala2 versions (#4341) @kitbellew
- CommunitySuite: create directory, ignore if exists (#4343) @kitbellew
- CommunitySuite: support excluding some styles (#4340) @kitbellew
- CommunityBuild: test community-code formatting (#4256) @kitbellew
Features
- ProjectFiles: add
.mill
to the default glob list (#4412) @kitbellew - NamedDialect: add all scala3 dialects (#4382) @kitbellew
- Allow to compile with Scala Native (#4325) @jchyb
- Separate regex patterns to jvm-only directory in preparation for Scala Native (#4309) @jchyb
- Prepare the build for cross compilation by renaming jvm sources (#4282) @jchyb
- Update libraries needed for cross compilation with Scala Native (#4283) @jchyb
- Replace java reflection with a macro-based solution (#4280) @jchyb
- Add literal.binPrefix setting to format binary literals. (#4183) @charpov
Bug fixes
- Router: apply space.inParens consistently (#4431) @kitbellew
- Router: no NL after
<-
in()
enums for scala3 (#4416) @kitbellew - Router: no conflict b/w preferNoSplit/skipNoSplit (#4415) @kitbellew
- Rewrite: remove one NL even if found many (#4413) @kitbellew
- Router: don't compare Option and Binpack.Site (#4320) @kitbellew
- CliOptions: write info to console instead of err (#4272) @kitbellew
- CliOptions: turn info into a stream+writer wrapper (#4271) @kitbellew
- ScalafmtCliReporter: use info for downloader (#4270) @kitbellew
- CliOptionsTest: expand, add tests, use System.out (#4269) @kitbellew
- CliOptions: clean-up determining when out is used (#4268) @kitbellew
- CliOptions: move NoopOutputStream to new Output (#4267) @kitbellew
- ScalafmtCoreRunner: print stack trace to stderr (#4266) @kitbellew
- Router: allow breaks in any double-quote strings (#4254) @kitbellew
- Scala3 syntax: remove braces around single import (#4223) @kitbellew
- ConfParsed: catch any runaway errors and wrap (#4208) @kitbellew
- ScalafmtDynamicSession: check config has a parent (#4185) @kitbellew
- Router: restore Shebang token handling (#4120) @kitbellew
- RedudantParens: generalize unary-literal check (#4119) @kitbellew
- RedundantParens: don't rewrite unary within select (#4118) @kitbellew
- RedundantParens: don't rewrite
Init
(#4124) @kitbellew
Miscellaneous
- Router: inline, remove TreeOps.findTemplate (#4433) @kitbellew
- Split/Modification: slightly change
toString()
(#4432) @kitbellew - LoggerOps: log optional token (#4361) @kitbellew
- Use new tree/token implicit extensions (#4322) @kitbellew
- ScalafmtDynamicError: include cause (#4313) @kitbellew
- Debug: capture and log routes (splits) (#4294) @kitbellew
- LoggerOps: add option to do no logging (#4289) @kitbellew
- Debug: don't assume completed state after
start
(#4288) @kitbellew - Split: keep 2 instances of FileLine, for debugging (#4273) @kitbellew
- Un'SKIP' tests which have been fixed previously (#4224) @kitbellew
- Debug: improve reporting visited tokens (#4221) @kitbellew
- ManualTests: re-use "ONLY" from HasTests (#4207) @kitbellew
Dependency and build updates
- Scalameta: upgrade to v4.10.2 (#4434) @kitbellew
- Workflows: change
master
tomain
(#4401) @kitbellew - SBT: upgrade scala 2.13 to patch 15 (#4324) @kitbellew
- Scalameta: upgrade to v4.10.1 (#4323) @kitbellew
- Scalameta: upgrade to v4.10.0 (#4321) @kitbellew
- Update sbt to 1.10.2 (#4305) @scalameta-bot
- Update munit to 1.0.2 (#4308) @scalameta-bot
- Update mdoc, sbt-mdoc to 2.6.1 (#4307) @scalameta-bot
- Update scalacheck to 1.18.1 (#4306) @scalameta-bot
- Update scala-library, scala-reflect to 2.12.20 (#4304) @scalameta-bot
- Update contributing-scalafmt.md (#4184) @charpov
- Update sbt-native-packager to 1.10.4 (#4179) @scalameta-bot
- Update sbt-ci-release to 1.6.1 (#4178) @scalameta-bot
- Update sbt-mima-plugin to 1.1.4 (#4180) @scalameta-bot
- Update munit to 1.0.1 (#4181) @scalameta-bot
- Update metaconfig-core, ... to 0.13.0 (#4177) @scalameta-bot
Bug fixes and supporting changes addressing bugs in formatting public code
- Router: fix handling of comment-space-dot chain (#4435) @kitbellew
- Split: make killOnFail an Option, set a default (#4428) @kitbellew
- FormatOps: simplify logic of defnSiteLastToken (#4427) @kitbellew
- State: don't penalize punct overflow (#4426) @kitbellew
- Router: don't penalize NL before
:
if keeping (#4425) @kitbellew - Router: remove optimal if avoid interpolation NL (#4423) @kitbellew
- State: delay penalty if
avoid
in interpolation (#4424) @kitbellew - BestFirstSearch: remove a useless optimization (#4421) @kitbellew
- FormatOps: extend SlbEnd to lbrace, colon, comment (#4422) @kitbellew
- Router: change lambda space splits (#4420) @kitbellew
- Router: move up check for no NL after
<-
enums (#4419) @kitbellew - ConvertToNewScala3Syntax: remove
:_
/@_
as unit (#4417) @kitbellew - Router: add dedicated rule for formatOff (#4411) @kitbellew
- FormatWriter: fix rare but possible bug (#4410) @kitbellew
- Router: fix performance of chained apply calls, with anon functions (#4409) @kitbellew
- OptimizationEntities: move TreeOps.statementStarts (#4408) @kitbellew
- FormatOps: fix ForYield as CtrlBody (#4406) @kitbellew
- Router: require NL before
}
if non-SLB({
(#4405) @kitbellew - TreeOps: inline getEnumStatements (#4404) @kitbellew
- FormatTokens: move distance from FormatOps (#4403) @kitbellew
- FormatTests: assert on the total number of visits (#4402) @kitbellew
- TreeOps: inline extractStatementsIfAny (#4397) @kitbellew
- Router: extend SLB optimal for
(...
(#4400) @kitbellew - FormatOps: SelectLike uses FormatToken as
name
(#4399) @kitbellew - FormatOps: extract helpers to OptimizationEntities (#4398) @kitbellew
- Literals: move Case inside the companion (#4396) @kitbellew
- FormatTokens: return FormatToken in matchingXxx (#4395) @kitbellew
- FormatTokens: define a few more methods (#4394) @kitbellew
- HasTests: parse and assert expected state visits (#4392) @kitbellew
- Router: increase penalty for NL before colon (#4389) @kitbellew
- RedundantBraces: keep if a comment is attached (#4384) @kitbellew
- RedundantParens: keep w/ dotless select in infix (#4386) @kitbellew
- FormatOps: ignore removed block in select chains (#4387) @kitbellew
- ScalafmtConfig: add
withFileOverride()
(#4383) @kitbellew - FormatOps: ignore source NL in binpacking ctors (#4379) @kitbellew
- FormatOps: use optimal slb end in binpacked
(...
(#4381) @kitbellew - BestFirstSearch: stop using State.allAltAreNL (#4369) @kitbellew
- TreeOps: also ignore single-stat rewritten blocks (#4377) @kitbellew
- TreeOps: ignore single block stat for NL optimizn (#4375) @kitbellew
- RedundantBraces: keep some around PartialFunction (#4374) @kitbellew
- TreeOps: revise NL-optimization around functions (#4372) @kitbellew
- Router: price sole NL split in
=> <NL>
at 1 (#4371) @kitbellew - FormatOps: no blank within infix if not enclosed (#4370) @kitbellew
- TreeOps: skip 1st stat in case body in NL optimizn (#4367) @kitbellew
- Router: price sole NL split in
=> comment
at 1 (#4366) @kitbellew - Router: no
startsStatement
for{
(#4365) @kitbellew - BestFirstSearch: call StateQueue.enqueue directly (#4362) @kitbellew
- Router: no
startsStatement
for=>
(#4364) @kitbellew - Router: consolidate splits around lambda (#4363) @kitbellew
- Router: check if "NL" for
(
is actually not NL (#4359) @kitbellew - TreeOps: get owners via token range, not position (#4357) @kitbellew
- RedundantBraces: keep around do-while within for (#4356) @kitbellew
- BestFirstSearch: arg clause an opt-zone for keep (#4354) @kitbellew
- Router: fix consistency based on src NL existence (#4355) @kitbellew
- FormatOps: extend slb end past select for
keep
(#4353) @kitbellew - Route: hide NL before dot for keep via a splittag (#4351) @kitbellew
- RemoveScala3OptionalBraces: not with no-NL select (#4352) @kitbellew
- Router: extract single stat from rewritten block (#4349) @kitbellew
- RedundantBraces:
else-if
always ok if opt-braces (#4339) @kitbellew - BestFirstSearch: optimal has low-penalty NL split (#4338) @kitbellew
- Router: bp=d...
v3.8.3
Features
- ScalafmtConfig: set line endings with git autoCRLF (#4114) @kitbellew
- Scalafmt: move line ending choice to FormatWriter (#4097) @kitbellew
- FormatWriter: prepare for configurable line ending (#4091) @kitbellew
- Documentation: describe
lineEndings
(#4090) @kitbellew
- Spaces: add
aroundSymbolicInfixOperators
params (#4103) @kitbellew - FormatWriter: check topLevelStatBlanks blank gaps (#4083) @kitbellew
- Router: use
spaces.afterColonInMatchPattern
(#4070) @kitbellew - Router: use
indent.{binPackXxx,afterInfix}Site
(#4057) @kitbellew
Bug fixes
- RedundantBraces: don't rewrite
try { (a, b) }
(#4111) @kitbellew - TokenOps: backquoted tokens don't "end" in symbol (#4107) @kitbellew
- Router: src=keep force NL only for matching
else
(#4105) @kitbellew - RedundantParens: handle parens around type as well (#4078) @kitbellew
- RedundantParens: allow any Ref, not just Name (#4077) @kitbellew
- RedundantParens: make body check more permissive (#4076) @kitbellew
- Add test with parens around types (#4075) @kitbellew
- FormatOps: in folded ctrl body, use
adjustedBody
(#4073) @kitbellew - Router: increase NL penalty within interpolation (#4068) @kitbellew
- FormatOps: treat assignment infix as non-infix rhs (#4065) @kitbellew
- RewriteTrailingCommas: handle optional braces case (#4059) @kitbellew
- Router: end
src=fold
single-line pastyield
(#4054) @kitbellew
Miscellaneous
- ScalafmtReflectConfig: add
withTarget
method (#4113) @kitbellew - Scalafmt: remove special case of space-only code (#4096) @kitbellew
- Scalafmt: remove special case of shebang prefix (#4095) @kitbellew
- FormatTokens: method to report token lookup error (#4088) @kitbellew
- FormatTokens: define a token hash builder (#4087) @kitbellew
- Token.LF: replace all references with Token.AtEOL (#4086) @kitbellew
- FormatWriter: use
HashMap.updateWith
(#4082) @kitbellew - Remove scala-2.11 specializations, no longer used (#4081) @kitbellew
- TreeOps: use common base in colonDeclType (#4080) @kitbellew
- RedundantBraces: refactor body checking (#4079) @kitbellew
- Modification: consistency, rename isNewline->isNL (#4074) @kitbellew
- Issue template: emphasize providing small example (#4069) @kitbellew
- TreeExtractors: use tree extns for assign/lt assoc (#4064) @kitbellew
- Router: support all enumerators, including
case
(#4063) @kitbellew - FormatOps: use Infix.isAssignment to skip indent (#4062) @kitbellew
- FormatOps: move ExtractFromMeta to companion obj (#4060) @kitbellew
- FormatOps: add InfixSplits.isAfterOp flag (#4061) @kitbellew
- Add no-indent infix test for right-assoc operator (#4056) @kitbellew
- Documentation: fix links to
binPack.xxxSite
(#4055) @kitbellew - Router: refactor single-line block logic (#4053) @kitbellew
- Split: allow ignoring withOptimalAt, relax check (#4052) @kitbellew
Dependency updates
- Scalameta: upgrade to v4.9.9 (#4115) @kitbellew
- Update mdoc, mdoc-parser, sbt-mdoc to 2.5.4 (#4110) @scalameta-bot
- FilterMatcher: turn into metaconfig-parsable type (#4102) @kitbellew
- FormatOps: slight refactor in
insideInfixSplit
(#4100) @kitbellew - Scalameta: upgrade to v4.9.8 (#4094) @kitbellew
- EmptyFileTest: use explicit
expected
(#4092) @kitbellew - Formatted: define Try[_]/Throwable ctors (#4093) @kitbellew
- Bump docker/build-push-action from 5 to 6 (#4085) @dependabot
- Update mdoc, mdoc-parser, sbt-mdoc to 2.5.3 (#4071) @scalameta-bot
- Update scalafmt-core to 3.8.2 (#4072) @scalameta-bot
- Scalameta: upgrade to v4.9.7 (#4066) @kitbellew