Skip to content

Commit

Permalink
Merge branch 'main' into installation
Browse files Browse the repository at this point in the history
  • Loading branch information
yshavit authored Feb 28, 2025
2 parents f1a0256 + e357b2e commit 127440d
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
9 changes: 8 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build-release

name: build-release
on:
push:
branches: [ "main" ]
Expand Down Expand Up @@ -34,6 +34,13 @@ jobs:
- uses: actions/checkout@v4
- name: build
run: cargo build --release
- name: check for any changes in the git tree
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo '::error title=post-build check::changes detected in git tree'
git status
exit 1
fi
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
with:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ jobs:
- uses: actions/checkout@v4
- name: cargo build
run: scripts/cargo_to_gh rustc --message-format json -- -Awarnings

- name: check for any changes in the git tree
run: |
exit_code=0
while read -r status_code file_path; do
if [[ -z "$status_code" ]]; then
continue
fi
exit_code=1
echo "::error file=$file_path,title=git-status::<$status_code> $file_path"
done <<<"$(git status --porcelain)"
exit "$exit_code"
check:
runs-on: ubuntu-latest
needs: build
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdq"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Select specific elements in a Markdown document"
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:alpine AS builder

WORKDIR /usr/src/app
RUN apk add --no-cache build-base

COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release && rm -rf src

COPY . .
RUN cargo build --release

FROM alpine:latest

COPY --from=builder /usr/src/app/target/release/mdq .

RUN chmod +x mdq

ENTRYPOINT ["./mdq"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ See the [tutorial] for a bit more detail, and [user manual] for the full picture

### Ensuring that people have searched existing issues before submitting a bug report

Many projects have bug report templates that ask the submitter to attest that they've checked existing issues for possible dupliates. In mdq, you can do:
Many projects have bug report templates that ask the submitter to attest that they've checked existing issues for possible duplicates. In mdq, you can do:

```bash
if echo "$ISSUE_TEXT" | mdq -q '- [x] I have searched for existing issues' ; then
Expand Down
2 changes: 1 addition & 1 deletion src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ mod tests {

// even works in pre_mode! Note that this has what look like extra newlines, due to how blocks get
// newlines. This can't happen in practice, since you can't have blocks inside a `pre` due to how we
// do with_pre_block vs with_block. See the docs on Block for mor.
// do with_pre_block vs with_block. See the docs on Block for more.
out.indenter.pre_mode = true;
out.write_str("[before-2]");
out.with_block(Block::Indent(2), |out| {
Expand Down
2 changes: 1 addition & 1 deletion tests/md_cases/footnotes_in_footnotes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ output = '''
'''


[expect."cyclic reference does't cause infinite loop"]
[expect."cyclic reference doesn't cause infinite loop"]
cli_args = ['- DDD | P: *']
output = '''
DDD: footnote contains cycle[^1]
Expand Down
2 changes: 1 addition & 1 deletion tests/md_cases/matchers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ output = '''


[expect."quoted"]
cli_args = ['- "world "'] # note: traiing space within the quote is significant
cli_args = ['- "world "'] # note: trailing space within the quote is significant
output = '''
- the world is my oyster
'''
Expand Down

0 comments on commit 127440d

Please sign in to comment.