Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover flatshapes #35

Merged
merged 26 commits into from
Dec 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e72a4f9
:construction: add some shapes
AucaCoyan Jun 21, 2023
8ae7105
:construction: add str interpolation boolean
AucaCoyan Jun 22, 2023
1392222
:construction: keep on lining
AucaCoyan Jun 23, 2023
c965da8
:sparkles: resolve some shapes and internal calls
AucaCoyan Jun 25, 2023
f7555d4
:twisted_rightwards_arrows: merge `upstream/main` into this branch
AucaCoyan Jun 29, 2023
b3180dc
:arrow_up: upgrade `nu` dependencies
AucaCoyan Jun 29, 2023
4ab533f
:rotating_light: fix clippy
AucaCoyan Jun 29, 2023
03078d3
:recycle: add `write_only_if_have_comments` fn
AucaCoyan Jun 29, 2023
6b49ff1
refactor the decl ids in an enumeration
amtoine Jul 8, 2023
cbda62d
remove useless comments
amtoine Jul 8, 2023
2cceede
make Clippy happy
amtoine Jul 8, 2023
7faac01
:twisted_rightwards_arrows: bring the changes of upstream/cover-flats…
AucaCoyan Jul 21, 2023
e0e4087
:construction: advance on write comments function
AucaCoyan Jul 21, 2023
1670dae
:bug: remove the merge marker and add link to license
AucaCoyan Jul 21, 2023
37d6bd6
:package: update `nu` packages
Oct 1, 2023
8863caf
:fire: remove string interpolation
Oct 1, 2023
c47174c
Merge remote-tracking branch 'upstream/main' into cover-flatshapes
Oct 7, 2023
93955e5
:bug: fix space in signature
Oct 17, 2023
4e5f322
:rotating_light: Fix clippy and update `nu` dependencies
AucaCoyan Dec 15, 2023
c48df19
:memo: Update nushell version in the README
AucaCoyan Dec 15, 2023
dc7735e
:white_check_mark: Fix failing tests
AucaCoyan Dec 15, 2023
581febd
:recycle: Refactor the boolean
AucaCoyan Dec 15, 2023
63b851e
:fire: Remove files
AucaCoyan Dec 15, 2023
1f385cf
Update docstring on `formatting.rs`
AucaCoyan Dec 16, 2023
07f5076
:fire: Remove unused comment
AucaCoyan Dec 16, 2023
8d8c2e5
:fire: Remove no longer used comment
AucaCoyan Dec 16, 2023
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
Prev Previous commit
Next Next commit
♻️ add write_only_if_have_comments fn
  • Loading branch information
AucaCoyan committed Jun 29, 2023
commit 03078d36bc2622642ba2936b3b09a98fa96ac570
28 changes: 14 additions & 14 deletions src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,7 @@
let printable = String::from_utf8_lossy(skipped_contents).to_string();
trace!("contents: {:?}", printable);

if skipped_contents.contains(&b'#') {
trace!("This have a comment. Writing.");
out.extend(trim_ascii_whitespace(skipped_contents));
out.push(b'\n');
} else {
trace!("The contents doesn't have a '#'. Skipping.");
}
out = write_only_if_have_comments(skipped_contents, out);
}

let mut bytes = working_set.get_span_contents(span);
Expand Down Expand Up @@ -128,13 +122,7 @@
let printable = String::from_utf8_lossy(remaining_contents).to_string();
trace!("contents: {:?}", printable);

if remaining_contents.contains(&b'#') {
trace!("This have a comment. Writing.");
out.push(b'\n');
out.extend(trim_ascii_whitespace(remaining_contents));
} else {
trace!("The contents doesn't have a '#'. Skipping.");
}
out = write_only_if_have_comments(remaining_contents, out)

Check failure on line 125 in src/formatting.rs

View workflow job for this annotation

GitHub Actions / lint all rust files

consider adding a `;` to the last statement for consistent formatting
}

start = span.end + 1;
Expand All @@ -149,6 +137,18 @@
bytes
}

/// given a list of `bytes` and a `out`put to write only the bytes if they contain `#`
fn write_only_if_have_comments(bytes: &[u8], mut out: Vec<u8>) -> Vec<u8> {
if bytes.contains(&b'#') {
trace!("This have a comment. Writing.");
out.push(b'\n');
out.extend(trim_ascii_whitespace(bytes));
} else {
trace!("The contents doesn't have a '#'. Skipping.");
}
out
}

#[allow(clippy::wildcard_in_or_patterns)]
fn resolve_call(c_bytes: &[u8], declid: usize, mut out: Vec<u8>) -> Vec<u8> {
out = match declid {
Expand Down
Loading