Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute filePaths used in output #769

Open
kimburgess opened this issue May 14, 2021 · 4 comments
Open

Absolute filePaths used in output #769

kimburgess opened this issue May 14, 2021 · 4 comments
Labels
Status: Need More Info Lacks enough info to make progress Status: Proposal Request for comments

Comments

@kimburgess
Copy link

What version of textlint are you using?
11.9.1

When running textlint, outputted results list absolute paths. Potential cause:

glob.sync(pattern, {
cwd,
absolute: true,
nodir: true,
ignore: ignoredPatterns
}).forEach((filePath: string) => {
// workaround for windows
// https://github.com/isaacs/node-glob/issues/74#issuecomment-31548810
addFile(path.resolve(filePath));
});

This behaviour deviates from the common linting tools and breaks compatibility with some commonly useful tooling, such as default configurations for GitHub problem matchers.

If absolute paths are desirable in some use cases, providing a CLI option to toggle between this and their relative equivalents would be beneficial to reducing external tooling requirements.

@azu
Copy link
Member

azu commented May 14, 2021

If the usecase is only GitHub problem matchers, we may create new formatter like eslint-stylish or github-actions

The current stylish format is a little different from eslint's stylish.
(textlint add to the resulting output when it is fixable. I've seen related blog https://qiita.com/nanakenashi/items/1797bedfa343833173f2)

@azu azu added Status: Need More Info Lacks enough info to make progress Status: Proposal Request for comments labels May 14, 2021
@kimburgess
Copy link
Author

While the stylish formatter has the incompatibility you note, compact does look to play nicely with eslint-compact.

It looks like the absolute paths may be compatible with the default matchers available in Actions, but have potentially hit another issue (actions/toolkit#810), unrelated to Textlint.

There are other cases where relative paths are useful so supporting that would be a wonderful feature.

@azu
Copy link
Member

azu commented May 17, 2021

There are other cases where relative paths are useful so supporting that would be a wonderful feature.

Yes, It is the best result.
However, textlint has --output-file flag. --output-file flag may make it difficult to output relative file path.

Probably, we need to pass some missing info like that is output-file path and cwd to formatted.

📝 tsuyoshicho/action-textlint provide another way for review comments on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need More Info Lacks enough info to make progress Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

2 participants