-
Notifications
You must be signed in to change notification settings - Fork 503
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
enhance(filecheck): validate all file paths for lowercase and special characters #8019
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, very good initiative, thanks! 👏
Just some nits and possible improvements:
273e7db
to
6242646
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
bb38976
to
f912638
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
f7341a0
to
e4d7b45
Compare
0ee9da7
to
b66832c
Compare
74f3674
to
7a13b7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OnkarRuikar thanks a lot for this. And sorry for not getting to it in time. I left some inline comments. But to sum it up. As soon as the minor regressions are fixed this is great and ready to go.
Cross reference: #10859 I wonder if we should only use characters that won't be URL encoded |
Co-authored-by: Claas Augner <[email protected]>
Co-authored-by: Claas Augner <[email protected]>
a7784ae
to
a483511
Compare
I've addressed this in the code: // Use only ASCII characters
const normalized = shortPath.normalize("NFD");
if (shortPath !== normalized) {
errors.push(
`Error: Invalid path: ${filePath}. Use only plain ASCII characters.`
);
} At the moment it logs:
|
@fiji-flo there is one more issue about filecheck tool. When content of an index.md is updated and surrounding image is no longer used in the content the image becomes orphan current tool doesn't report it on index.md modifications. The tool needs to look in the parent directory of index.md for images and check them as well. Should we fix this in this PR or handle it in a new one? |
Sorry for the late reply, I would recommend to open a separate PR. |
can we merge this now then? 😃 |
Addresses mdn/content#20470 (comment)
Ban parentheses from content file paths.
The PR also fixes currently on going erroneous message:
Error: files/en-us/web/http/cookies/cookie-basic-example.drawio file-type could not be extracted at all (probably not a .drawio file)
This is because the code considers
.drawio
as a binary file.