Skip to content

Commit

Permalink
fix(build): resolve bugs, change crates and binary name (#9)
Browse files Browse the repository at this point in the history
* fix(docstring): resolve java and python formatting bugs

* fix(build): change crate and binary name
  • Loading branch information
wilhelmagren committed Oct 1, 2023
1 parent 9f743ac commit 0dcd3c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "docstring"
name = "docstring-rs"
version = "0.2.0"
authors = [ "Wilhelm 脜gren <wilhelmagren98@gmail.com>" ]
description = "馃搾 Generate or update docstrings for new and existing files. "
Expand All @@ -11,7 +11,7 @@ edition = "2021"
keywords = [ "rust", "cli", "documentation", "automation" ]
categories = [ "command-line-utilities" ]
include = [ "**/*.rs", "Cargo.toml", "LICENSE", "README.md" ]
default-run = "docstring"
default-run = "docstring-rs"

[dependencies]
chrono = "0.4.31"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ coverage:

.PHONY: run
run:
./target/release/docstring
./target/release/docstring-rs

.PHONY: publish-dry
publish-dry:
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ fn find_filetype(file: &str) -> Result<FileType, io::Error> {
"cpp" => Ok(FileType::Cpp),
"cxx" => Ok(FileType::Cpp),
"rs" => Ok(FileType::RS),
"PY" => Ok(FileType::PY),
"JS" => Ok(FileType::JS),
"TS" => Ok(FileType::TS),
"JAVA" => Ok(FileType::Java),
"py" => Ok(FileType::PY),
"js" => Ok(FileType::JS),
"ts" => Ok(FileType::TS),
"java" => Ok(FileType::Java),
_ => Err(io::Error::new(
io::ErrorKind::NotFound,
"no matching filetype",
Expand All @@ -234,7 +234,7 @@ fn get_multiline_comment_by_filetype(ft: &FileType) -> (&'static str, &'static s
FileType::C => ("/*", "* ", "*/"),
FileType::Cpp => ("/*", "* ", "*/"),
FileType::RS => ("/*", "* ", "*/"),
FileType::PY => (r#"""#, "", r#"""#),
FileType::PY => ("\"\"\"", "", "\"\"\""),
FileType::JS => ("/*", "* ", "*/"),
FileType::TS => ("/*", "* ", "*/"),
FileType::Java => ("/*", "* ", "*/"),
Expand Down

0 comments on commit 0dcd3c9

Please sign in to comment.