Azure / Azure/azure-rest-api-specs

[suppressions] Use path.resolve() instead of path.join() on suppression paths

Open
#37,535 0 comments 0 reactions 1 assignee Claimed by @mikeharder View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

https://github.com/Azure/azure-rest-api-specs/blob/959652aca6777cd5db6fd792be4e52dfbaa122ef/eng/tools/suppressions/src/suppressions.ts#L170-L173

L171 should use `path.resolve()` instead of `path.join()`. They are usually the same, but diverge if the second argument is an absolute path. The behavior of `resolve()` is more appropriate here.

```
> path.join("/home/specs", "foo/bar")
'/home/specs/foo/bar'
> path.resolve("/home/specs", "foo/bar")
'/home/specs/foo/bar'

> path.join("/home/specs", "/foo/bar")
'/home/specs/foo/bar'
> path.resolve("/home/specs", "/foo/bar")
'/foo/bar'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.