Skip to content

Add proper deprecation logic for features & deprecate Ammonite for removal - #4218

Merged
Gedochao merged 4 commits into
VirtusLab:mainfrom
Gedochao:update/ammonite-3.0.9
Apr 10, 2026
Merged

Gedochao merged 4 commits into
VirtusLab:mainfrom
Gedochao:update/ammonite-3.0.9

Conversation

@Gedochao

@Gedochao Gedochao commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3258

  • bumps Ammonite to 3.0.9 (where it deprecates itself)
  • adds logic for deprecating features (command line options, directive aliases, sub-commands, config keys)
  • adds logic for suppression of deprecation warnings
  • adds an agent skill for deprecating features
  • deprecates all Ammonite flags (--ammonite, --ammonite-version, and --ammonite-arg)

Examples

  • Ammonite deprecation
scala-cli --amm --power --ammonite-arg -c --ammonite-arg 'println("Hello")'
# [warn] Some utilized features are deprecated:
#  - `--amm` option is deprecated. Ammonite integration is deprecated. Use the default Scala REPL instead.
#  - `--ammonite-arg` option is deprecated. Ammonite integration is deprecated. Use the default Scala REPL instead.
# Deprecated features may be removed in a future version.
# Scala 3.8.3 is not yet supported with this version of Ammonite
# Defaulting to Scala 3.8.1
# Downloading Ammonite 3.0.9 sources
# Compiling /Users/pchabelski/IdeaProjects/scala-cli/(console)
# Hello
  • deprecation warning suppression via command line option
scala-cli run Hello.scala --deprecated-test-option --suppress-deprecated-warnings
  • deprecation warning suppression via config
scala-cli config suppress-warning.deprecated-features true

Checklist

  • tested the solution locally and it works
  • ran the code formatter (scala-cli fmt .)
  • ran scalafix (./mill -i __.fix)
  • ran reference docs auto-generation (./mill -i 'generate-reference-doc[]'.run)

How much have your relied on LLM-based tools in this contribution?

a lot; Cursor + Claude

How was the solution tested?

Added dummy features of each category and automated tests for how the CLI warns on each of them.

1. --deprecated-test-option (full option deprecation)

scala-cli run Hello.scala --deprecated-test-option
# [warn] --deprecated-test-option is deprecated: For testing purposes only.

2. --deprecated-test-alias (alias deprecation)

scala-cli run Hello.scala --deprecated-test-alias
# [warn] --deprecated-test-alias is deprecated

3. //> using deprecatedTestDirective (directive deprecated with replacement)

//> using deprecatedTestDirective
# [warn] 'deprecatedTestDirective' is deprecated: use 'testDirective' instead
# (IDE quick-fix offered: change to 'testDirective')

4. //> using deprecatedForRemovalTestDirective (directive deprecated for removal)

//> using deprecatedForRemovalTestDirective
# [warn] Using 'deprecatedForRemovalTestDirective' is deprecated and will be removed in a future version
# (no IDE quick-fix offered)

5. test.deprecated-key (config key deprecation)

scala-cli config test.deprecated-key true
# [warn] test.deprecated-key is deprecated: For testing purposes only.

Tests pass locally.

Additional notes

@Gedochao
Gedochao force-pushed the update/ammonite-3.0.9 branch 3 times, most recently from 5643695 to ce924e5 Compare April 9, 2026 12:50
@Gedochao
Gedochao force-pushed the update/ammonite-3.0.9 branch from ce924e5 to afd89e8 Compare April 9, 2026 12:50
@Gedochao
Gedochao force-pushed the update/ammonite-3.0.9 branch from afd89e8 to 5f46837 Compare April 9, 2026 12:54
@Gedochao
Gedochao marked this pull request as ready for review April 9, 2026 13:20
@Gedochao
Gedochao requested review from tgodzik and zielinsky April 9, 2026 13:20
@Gedochao
Gedochao enabled auto-merge April 10, 2026 04:51
@Gedochao
Gedochao merged commit ce16108 into VirtusLab:main Apr 10, 2026
179 of 184 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a mechanism for deprecation of features

2 participants