Skip to content

Commit

Permalink
Bump, check flag
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Aug 15, 2022
1 parent ca1480f commit e566940
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 38 deletions.
51 changes: 26 additions & 25 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, religion, or sexual identity and
orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand All @@ -60,8 +60,8 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.
[email protected]. All complaints will be reviewed and investigated promptly
and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand All @@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -106,19 +106,20 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
Community Impact Guidelines were inspired by
[Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/LeoDog896/deno-outdated)

Pins your dependencies to the latest version & updates existing ones.

```bash
deno install --allow-read=./ --allow-net --allow-write=./ -f -n=deno-outdated https://deno.land/x/deno_outdated/cli.ts
```

Or, add it to your deno.json's tasks:
Or, add it to your deno.json's (or deno.jsonc) tasks:

```json
"update": "deno run --allow-read=./ --allow-net --allow-write=./ https://deno.land/x/deno_outdated/cli.ts --ignore README.md",
"update": "deno run --allow-read=./ --allow-net --allow-write=./ https://deno.land/x/deno_outdated/cli.ts",
```

Pins your dependencies to the latest version & updates existing ones.

## Flags

- `-q, --quiet`: Silence CLI output
Expand Down
25 changes: 19 additions & 6 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command } from "https://deno.land/x/[email protected]/command/mod.ts";
import { basename, join } from "https://deno.land/std@0.151.0/path/mod.ts";
import { basename, join } from "https://deno.land/std@0.152.0/path/mod.ts";
import { findAndReplace } from "./change.ts";

export async function* recursiveReaddir(
Expand All @@ -19,6 +19,7 @@ export async function* recursiveReaddir(

async function update(
quiet: boolean,
check: boolean,
ignore: string[] = [],
lineIgnore: string,
debug = false,
Expand All @@ -38,10 +39,14 @@ async function update(
const newSource = await findAndReplace(originalSource, lineIgnore);

if (newSource !== originalSource) {
await Deno.writeTextFile(
file,
newSource,
);
if (check) {
console.log(`${file} needs updating`);
} else {
await Deno.writeTextFile(
file,
newSource,
);
}

count++;

Expand Down Expand Up @@ -71,12 +76,20 @@ await new Command()
default: "i-deno-outdated",
},
)
.option(
"-c --check",
"True if the editor shouldn't change files and tell you about outdated dependencies.",
{
default: false,
},
)
.description(
"Check for outdated dependencies for deno.land/x and other various 3rd party vendors",
)
.action(async ({ quiet, ignore, lineIgnore, debug }) => {
.action(async ({ quiet, ignore, lineIgnore, debug, check }) => {
const count = await update(
quiet,
check,
Array.isArray(ignore) ? ignore : [],
typeof lineIgnore === "string" ? lineIgnore : "i-deno-outdated",
debug,
Expand Down
2 changes: 1 addition & 1 deletion test/change.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertEquals,
assertNotEquals,
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
} from "https://deno.land/std@0.152.0/testing/asserts.ts";

Deno.test("Source code translation works", async () => {
const source = "const x = 'https://deno.land/[email protected]/testing/asserts.ts'"; // i-deno-outdated
Expand Down
2 changes: 1 addition & 1 deletion test/redirect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { checkRedirect } from "../redirect.ts";
import {
assertEquals,
assertNotEquals,
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
} from "https://deno.land/std@0.152.0/testing/asserts.ts";

Deno.test("Redirects redirect to another URL (against deno.land/x)", async () => {
const redirect = await checkRedirect("https://deno.land/x/cliffy/mod.ts"); // i-deno-outdated
Expand Down
2 changes: 1 addition & 1 deletion test/regex.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { apply } from "../regex.ts";
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
import { assertEquals } from "https://deno.land/std@0.152.0/testing/asserts.ts";

Deno.test("Removal works (deno.land/x)", () => {
const url = "https://deno.land/x/[email protected]/mod.ts";
Expand Down

0 comments on commit e566940

Please sign in to comment.