Skip to content

Commit

Permalink
fix: path resolution (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricRibeiro authored Jul 25, 2023
1 parent 8e9835a commit d02c21e
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 4 deletions.
14 changes: 13 additions & 1 deletion .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@ workflows:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
# Test your orb's commands in a custom job and test your orb's jobs directly as a part of this workflow.
- vale/lint:
name: vale-lint-all
base_dir: "sample/"
filters: *filters
- vale/lint:
name: vale-lint-md
base_dir: "sample/"
glob: "*/test.md"
filters: *filters
- vale/lint:
name: vale-lint-readme
glob: "*/README.md"
filters: *filters
# The orb must be re-packed for publishing, and saved to the workspace.
- orb-tools/pack:
filters: *release-filters
Expand All @@ -37,7 +47,9 @@ workflows:
# Ensure this job requires all test jobs and the pack job.
requires:
- orb-tools/pack
- vale/lint
- vale-lint-all
- vale-lint-md
- vale-lint-readme
context: orb-publisher
github_token: GHI_TOKEN
filters: *release-filters
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A CircleCI orb for [Vale](https://github.com/errata-ai/vale) from [errata.ai](ht
---
### How to Contribute

We welcome [issues](https://github.com/CircleCI-Public/vale-orb/issues) to and [pull requests](https://github.com/CircleCI-Public/vale-orb/pulls) against this repository!
We welcome [issues](https://github.com/CircleCI-Public/vale-orb/issues) to and [pull requests](https://github.com/CircleCI-Public/vale-orb/pulls) against this repository.

### How to Publish An Update
1. Merge pull requests with desired changes to the main branch.
Expand Down
39 changes: 39 additions & 0 deletions sample/sample-subdirectory/test.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
= Document Title
Doc Writer <doc@example.com>
:reproducible:
:listing-caption: Listing
:source-highlighter: rouge
:toc:
// Uncomment next line to add a title page (or set doctype to book)
//:title-page:
// Uncomment next line to set page size (default is A4)
//:pdf-page-size: Letter

An example of a basic https://asciidoc.org[AsciiDoc] document prepared by {author}.

== Introduction

A paragraph followed by an unordered list{empty}footnote:[AsciiDoc supports unordered, ordered, and description lists.] with square bullets.footnote:[You may choose from square, disc, and circle for the bullet style.]

[square]
* item 1
* item 2
* item 3

== Main

Here's how you say "`Hello, World.`" in Prawn:

.Create a basic PDF document using Prawn
[source,ruby]
----
require 'prawn'
Prawn::Document.generate 'example.pdf' do
text 'Hello, World.'
end
----

== Conclusion

That's all, folks.
10 changes: 10 additions & 0 deletions sample/sample-subdirectory/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<h1>Test</h1>
<p>This is a sample document in HTML.</p>
</body>
</html>
8 changes: 8 additions & 0 deletions sample/sample-subdirectory/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
author: circleci
tags: [circleci, test]
title: Test
---

# Test

This is a sample document for testing the Vale CLI.
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The default `.circleci/config.yml` file contains the configuration code needed t

## @orb.yml

This is the entry point for our orb "tree", which becomes our `orb.yml` file later.
This is the entry point for our orb "tree," which becomes our `orb.yml` file later.

Within the `@orb.yml` we generally specify 4 configuration keys

Expand Down
2 changes: 1 addition & 1 deletion src/jobs/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:
description: "Glob pattern to match files against. By default, all markdown and AsciiDoc files will be linted."
base_dir:
type: string
default: "."
default: "$CIRCLE_WORKING_DIRECTORY"
description: "Base directory to run Vale from. By default, Vale will run in the current directory."
config:
type: string
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ redtext() {

VALE_EVAL_CLI_CONFIG="$(eval echo "$VALE_EVAL_CLI_CONFIG")"
VALE_STR_CLI_GLOB="$(circleci env subst "$VALE_STR_CLI_GLOB")"

VALE_EVAL_CLI_BASE_DIR="$(eval echo "$VALE_EVAL_CLI_BASE_DIR")"
VALE_EVAL_CLI_BASE_DIR="${VALE_EVAL_CLI_BASE_DIR/\~/$HOME}"

if [[ ! -f "$VALE_EVAL_CLI_CONFIG" ]]; then
redtext "No configuration file found at $VALE_EVAL_CLI_CONFIG"
Expand Down
1 change: 1 addition & 0 deletions styles/Vocab/CircleCI/accept.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
circleci
CircleCI

0 comments on commit d02c21e

Please sign in to comment.