arrowrowe / textlint-rule-editorconfig

Let EditorConfig and Textlint work together.
MIT License
11 stars 4 forks source link

Use relative path in filepath matching #3

Closed stak closed 6 years ago

stak commented 6 years ago

EditorConfig permits relative path in section names:

# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2

(from: http://editorconfig.org/)

But above config fails because textlint-rule-editorconfig compares absolute path of the target file with patterns written in .editorconfig.

new Minimatch('lib/**.js').match('/full/path/to/lib/some.js') // => false

This PR fixes it.

codecov-io commented 6 years ago

Codecov Report

Merging #3 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #3   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines         167    173    +6     
=====================================
+ Hits          167    173    +6
Impacted Files Coverage Δ
editorconfig/get-root.js 100% <100%> (ø) :arrow_up:
editorconfig/get-config.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update aeb27cf...364dd5d. Read the comment docs.

arrowrowe commented 6 years ago

Awesome! :tada: Thanks w