Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ jobs:
fi
echo "VERSION=$version" >> "$GITHUB_ENV"
cargo xtask install --root "$RUNNER_TEMP/install"
cargo install --path . --locked --features all-languages --root "$RUNNER_TEMP/full"
"$PYTHON" scripts/release.py pack --version "$version" --target "$TARGET" --install "$RUNNER_TEMP/install" --output dist
"$PYTHON" scripts/release.py pack --version "$version" --target "$TARGET" --install "$RUNNER_TEMP/full" --edition full --output dist
- name: Verify extracted archives without Bun or checkout assets
run: |
# The TUI smoke test drives a Unix PTY.
Expand All @@ -66,7 +64,6 @@ jobs:
"$PYTHON" xtask/tests/smoke_install.py "$RUNNER_TEMP/extracted"
fi
"$PYTHON" scripts/smoke_cli_archive.py "dist/diffr-cli-$VERSION-$TARGET.tar.gz" "$VERSION"
"$PYTHON" scripts/smoke_cli_archive.py "dist/diffr-cli-full-$VERSION-$TARGET.tar.gz" "$VERSION"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.target }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ jobs:
bun-version: 1.3.10
- uses: dtolnay/rust-toolchain@1.99.0
- run: cargo build --locked
- run: cargo test --locked --features all-languages --bin diffr --test cli
- working-directory: diffr-ts
run: |
bun install --frozen-lockfile
Expand Down
12 changes: 0 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,3 @@ assets = [
[ "diffr.1", "usr/share/man/man1/", "644" ],
[ "CHANGELOG.md", "usr/share/doc/difftastic/", "644" ],
]

[features]
all-languages = ["lang-fortran", "lang-fsharp", "lang-verilog", "lang-ocaml", "lang-julia", "lang-haskell", "lang-vhdl", "lang-apex", "lang-qml"]
lang-fortran = ["diffr-core/lang-fortran"]
lang-fsharp = ["diffr-core/lang-fsharp"]
lang-verilog = ["diffr-core/lang-verilog"]
lang-ocaml = ["diffr-core/lang-ocaml"]
lang-julia = ["diffr-core/lang-julia"]
lang-haskell = ["diffr-core/lang-haskell"]
lang-vhdl = ["diffr-core/lang-vhdl"]
lang-apex = ["diffr-core/lang-apex"]
lang-qml = ["diffr-core/lang-qml"]
28 changes: 9 additions & 19 deletions crates/diffr-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,42 +65,42 @@ tree-sitter-elixir = "0.3.4"
tree-sitter-elm = "5.8.0"
tree-sitter-erlang = "0.20.0"
tree-sitter-fish = "3.6.0"
tree-sitter-fortran = { version = "0.6.0", optional = true }
tree-sitter-fsharp = { version = "0.3.0", optional = true }
tree-sitter-fortran = "0.6.0"
tree-sitter-fsharp = "0.3.0"
tree-sitter-gleam = "1.0.0"
tree-sitter-go = "0.25.0"
tree-sitter-haskell = { version = "0.23.1", optional = true }
tree-sitter-haskell = "0.23.1"
tree-sitter-hcl = "1.1.0"
tree-sitter-html = "0.23.2"
tree-sitter-java-orchard = "0.5.9"
tree-sitter-javascript = "0.25.0"
tree-sitter-json = "0.24.8"
tree-sitter-julia = { version = "0.23.1", optional = true }
tree-sitter-julia = "0.23.1"
tree-sitter-lua = "0.5"
tree-sitter-make = "1.1.1"
tree-sitter-newick = "1.1.0"
tree-sitter-nix = "0.3.0"
tree-sitter-objc = "3.0.2"
tree-sitter-ocaml = { version = "0.25.0", optional = true }
tree-sitter-ocaml = "0.25.0"
tree-sitter-pascal = "0.10.0"
tree-sitter-php = "0.24.0"
tree-sitter-proto = "0.4.0"
tree-sitter-python = "0.25.0"
tree-sitter-qmljs = { version = "0.3.0", optional = true }
tree-sitter-qmljs = "0.3.0"
tree-sitter-r = "1.2.0"
tree-sitter-racket = "0.24.7"
tree-sitter-ruby = "0.23.1"
tree-sitter-rust-orchard = "0.16.6"
tree-sitter-scala = "0.26.2"
tree-sitter-scheme = "0.24.7"
tree-sitter-sequel = "0.3.11"
tree-sitter-sfapex = { version = "2.4.0", optional = true }
tree-sitter-sfapex = "2.4.0"
tree-sitter-solidity = "1.2.13"
tree-sitter-swift = "0.7.1"
tree-sitter-toml-ng = "0.7.0"
tree-sitter-typescript = "0.23.2"
tree-sitter-verilog = { version = "1.0.3", optional = true }
tree-sitter-vhdl = { version = "1.4.0", optional = true }
tree-sitter-verilog = "1.0.3"
tree-sitter-vhdl = "1.4.0"
tree-sitter-xml = "0.7.0"
tree-sitter-yaml = "0.7.0"
tree-sitter-zig = "1.1.2"
Expand All @@ -122,15 +122,5 @@ tempfile = "3.27.0"
toml = "0.8"

[features]
all-languages = ["lang-fortran", "lang-fsharp", "lang-verilog", "lang-ocaml", "lang-julia", "lang-haskell", "lang-vhdl", "lang-apex", "lang-qml"]
lang-fortran = ["dep:tree-sitter-fortran", "diffr-grammars/lang-fortran"]
lang-fsharp = ["dep:tree-sitter-fsharp", "diffr-grammars/lang-fsharp"]
lang-verilog = ["dep:tree-sitter-verilog", "diffr-grammars/lang-verilog"]
lang-ocaml = ["dep:tree-sitter-ocaml", "diffr-grammars/lang-ocaml"]
lang-julia = ["dep:tree-sitter-julia", "diffr-grammars/lang-julia"]
lang-haskell = ["dep:tree-sitter-haskell", "diffr-grammars/lang-haskell"]
lang-vhdl = ["dep:tree-sitter-vhdl", "diffr-grammars/lang-vhdl"]
lang-apex = ["dep:tree-sitter-sfapex", "diffr-grammars/lang-apex"]
lang-qml = ["dep:tree-sitter-qmljs", "diffr-grammars/lang-qml"]
# Constructors and helpers the diffr package's tests build on.
test-support = []
39 changes: 0 additions & 39 deletions crates/diffr-core/src/parse/guess_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use strum::{EnumIter, IntoEnumIterator};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, EnumIter)]
pub enum Language {
Ada,
#[cfg(feature = "lang-apex")]
Apex,
Asm,
Bash,
Expand All @@ -39,13 +38,10 @@ pub enum Language {
EmacsLisp,
Erlang,
Fish,
#[cfg(feature = "lang-fsharp")]
FSharp,
#[cfg(feature = "lang-fortran")]
Fortran,
Gleam,
Go,
#[cfg(feature = "lang-haskell")]
Haskell,
Hcl,
Html,
Expand All @@ -54,7 +50,6 @@ pub enum Language {
JavaScript,
JavascriptJsx,
Json,
#[cfg(feature = "lang-julia")]
Julia,
Kotlin,
LaTeX,
Expand All @@ -63,16 +58,13 @@ pub enum Language {
Newick,
Nix,
ObjC,
#[cfg(feature = "lang-ocaml")]
OCaml,
#[cfg(feature = "lang-ocaml")]
OCamlInterface,
Pascal,
Perl,
Php,
Proto,
Python,
#[cfg(feature = "lang-qml")]
Qml,
R,
Racket,
Expand All @@ -87,9 +79,7 @@ pub enum Language {
Toml,
TypeScript,
TypeScriptTsx,
#[cfg(feature = "lang-verilog")]
Verilog,
#[cfg(feature = "lang-vhdl")]
Vhdl,
Xml,
Yaml,
Expand Down Expand Up @@ -131,7 +121,6 @@ pub fn language_override_from_name(name: &str) -> Option<LanguageOverride> {
pub fn language_name(language: Language) -> &'static str {
match language {
Ada => "Ada",
#[cfg(feature = "lang-apex")]
Apex => "Apex",
Asm => "Assembly",
Bash => "Bash",
Expand All @@ -150,13 +139,10 @@ pub fn language_name(language: Language) -> &'static str {
EmacsLisp => "Emacs Lisp",
Erlang => "Erlang",
Fish => "Fish",
#[cfg(feature = "lang-fsharp")]
FSharp => "F#",
#[cfg(feature = "lang-fortran")]
Fortran => "Fortran",
Gleam => "Gleam",
Go => "Go",
#[cfg(feature = "lang-haskell")]
Haskell => "Haskell",
Hcl => "HCL",
Html => "HTML",
Expand All @@ -165,7 +151,6 @@ pub fn language_name(language: Language) -> &'static str {
JavaScript => "JavaScript",
JavascriptJsx => "JavaScript JSX",
Json => "JSON",
#[cfg(feature = "lang-julia")]
Julia => "Julia",
Kotlin => "Kotlin",
LaTeX => "LaTeX",
Expand All @@ -174,16 +159,13 @@ pub fn language_name(language: Language) -> &'static str {
Newick => "Newick",
Nix => "Nix",
ObjC => "Objective-C",
#[cfg(feature = "lang-ocaml")]
OCaml => "OCaml",
#[cfg(feature = "lang-ocaml")]
OCamlInterface => "OCaml Interface",
Pascal => "Pascal",
Perl => "Perl",
Php => "PHP",
Proto => "Proto",
Python => "Python",
#[cfg(feature = "lang-qml")]
Qml => "QML",
R => "R",
Racket => "Racket",
Expand All @@ -198,9 +180,7 @@ pub fn language_name(language: Language) -> &'static str {
Toml => "TOML",
TypeScript => "TypeScript",
TypeScriptTsx => "TypeScript TSX",
#[cfg(feature = "lang-verilog")]
Verilog => "Verilog",
#[cfg(feature = "lang-vhdl")]
Vhdl => "VHDL",
Xml => "XML",
Yaml => "YAML",
Expand Down Expand Up @@ -265,7 +245,6 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
"zshenv",
"zshrc",
],
#[cfg(feature = "lang-apex")]
Apex => &["*.apexc", "*.trigger"],
C => &["*.c"],
Clojure => &[
Expand Down Expand Up @@ -310,13 +289,10 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
"rebar.lock",
],
Fish => &["*.fish"],
#[cfg(feature = "lang-fsharp")]
FSharp => &["*.fs", "*.fsx", "*.fsi"],
#[cfg(feature = "lang-fortran")]
Fortran => &["*.f", "*.for", "*.f90", "*.F", "*.FOR", "*.F90"],
Gleam => &["*.gleam"],
Go => &["*.go"],
#[cfg(feature = "lang-haskell")]
Haskell => &["*.hs"],
Hcl => &["*.hcl", "*.nomad", "*.tf", "*.tfvars", "*.workflow"],
Html => &["*.html", "*.htm", "*.xhtml"],
Expand Down Expand Up @@ -354,7 +330,6 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
"flake.lock",
],
JavascriptJsx => &["*.jsx"],
#[cfg(feature = "lang-julia")]
Julia => &["*.jl"],
Kotlin => &["*.kt", "*.ktm", "*.kts"],
LaTeX => &["*.aux", "*.cls", "*.sty", "*.tex"],
Expand Down Expand Up @@ -383,9 +358,7 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
Newick => &["*.nhx", "*.nwk", "*.nh"],
Nix => &["*.nix"],
ObjC => &["*.m"],
#[cfg(feature = "lang-ocaml")]
OCaml => &["*.ml"],
#[cfg(feature = "lang-ocaml")]
OCamlInterface => &["*.mli"],
Pascal => &["*.pas", "*.dfm", "*.dpr", "*.lpr", "*.pascal"],
Perl => &["*.pm", "*.pl"],
Expand All @@ -394,7 +367,6 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
],
Proto => &["*.proto"],
Python => &["*.py", "*.py3", "*.pyi", "*.bzl", "TARGETS", "BUCK", "DEPS"],
#[cfg(feature = "lang-qml")]
Qml => &["*.qml"],
R => &["*.R", "*.r", "*.rd", "*.rsx", ".Rprofile", "expr-dist"],
Racket => &["*.rkt"],
Expand Down Expand Up @@ -424,9 +396,7 @@ pub fn language_globs(language: Language) -> Vec<glob::Pattern> {
],
TypeScript => &["*.ts", "*.cts", "*.mts"],
TypeScriptTsx => &["*.tsx"],
#[cfg(feature = "lang-verilog")]
Verilog => &["*.v", "*.sv", "*.vh"],
#[cfg(feature = "lang-vhdl")]
Vhdl => &["*.vhdl", "*.vhd"],
Xml => &[
"*.ant",
Expand Down Expand Up @@ -575,13 +545,10 @@ fn from_emacs_mode_header(src: &str) -> Option<Language> {
"elm" => Elm,
"emacs-lisp" => EmacsLisp,
"fish" => Fish,
#[cfg(feature = "lang-fsharp")]
"fsharp" => FSharp,
#[cfg(feature = "lang-fortran")]
"fortran" => Fortran,
"gleam" => Gleam,
"go" => Go,
#[cfg(feature = "lang-haskell")]
"haskell" => Haskell,
"hcl" => Hcl,
"html" => Html,
Expand All @@ -603,12 +570,9 @@ fn from_emacs_mode_header(src: &str) -> Option<Language> {
"sql" => Sql,
"swift" => Swift,
"toml" => Toml,
#[cfg(feature = "lang-ocaml")]
"tuareg" => OCaml,
"typescript" => TypeScript,
#[cfg(feature = "lang-verilog")]
"verilog" => Verilog,
#[cfg(feature = "lang-vhdl")]
"vhdl" => Vhdl,
"yaml" => Yaml,
"zig" => Zig,
Expand Down Expand Up @@ -637,11 +601,9 @@ fn from_shebang(src: &str) -> Option<Language> {
"elixir" => return Some(Elixir),
"escript" => return Some(Erlang),
"fish" => return Some(Fish),
#[cfg(feature = "lang-haskell")]
"runghc" | "runhaskell" | "runhugs" => return Some(Haskell),
"chakra" | "d8" | "gjs" | "js" | "node" | "nodejs" | "qjs" | "rhino" | "v8"
| "v8-shell" => return Some(JavaScript),
#[cfg(feature = "lang-ocaml")]
"ocaml" | "ocamlrun" | "ocamlscript" => return Some(OCaml),
"perl" => return Some(Perl),
"python" | "python2" | "python3" => return Some(Python),
Expand Down Expand Up @@ -751,7 +713,6 @@ mod tests {
}

#[test]
#[cfg(feature = "lang-ocaml")]
fn test_guess_by_emacs_mode_shorthand() {
let path = Path::new("foo");
assert_eq!(guess(path, "(* -*- tuareg -*- *)", &[]), Some(OCaml));
Expand Down
Loading
Loading