-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
bb9bff7
commit 43fe125
Showing
6 changed files
with
237 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## [@siteimprove/alfa-css](packages/alfa-css) | ||
|
||
### @todo | ||
|
||
- [src/properties/text-decoration/color/property.ts:21](packages/alfa-css/src/properties/text-decoration/color/property.ts#L21): Should be currentColor when supported in colorGrammar | ||
|
||
## [@siteimprove/alfa-dom](packages/alfa-dom) | ||
|
||
### @todo | ||
|
||
- [src/is-rendered.ts:19](packages/alfa-dom/src/is-rendered.ts#L19): Handle `display: contents` once it gains wider support. | ||
|
||
## [@siteimprove/alfa-aria](packages/alfa-aria) | ||
|
||
### @todo | ||
|
||
- [src/features/html/th.ts:6](packages/alfa-aria/src/features/html/th.ts#L6): Need to handle the auto state | ||
- [src/features/svg/a.ts:21](packages/alfa-aria/src/features/svg/a.ts#L21): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/circle.ts:10](packages/alfa-aria/src/features/svg/circle.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/ellipse.ts:10](packages/alfa-aria/src/features/svg/ellipse.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/foreign-object.ts:10](packages/alfa-aria/src/features/svg/foreign-object.ts#L10): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/g.ts:10](packages/alfa-aria/src/features/svg/g.ts#L10): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/image.ts:10](packages/alfa-aria/src/features/svg/image.ts#L10): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/line.ts:10](packages/alfa-aria/src/features/svg/line.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/mesh.ts:10](packages/alfa-aria/src/features/svg/mesh.ts#L10): In certain rare circumstances the role will in this case be img. Investigate. | ||
- [src/features/svg/path.ts:10](packages/alfa-aria/src/features/svg/path.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/polygon.ts:10](packages/alfa-aria/src/features/svg/polygon.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/polyline.ts:10](packages/alfa-aria/src/features/svg/polyline.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/rect.ts:10](packages/alfa-aria/src/features/svg/rect.ts#L10): In certain rare circumstances the role will in this case be graphics-symbol. Investigate. | ||
- [src/features/svg/symbol.ts:10](packages/alfa-aria/src/features/svg/symbol.ts#L10): In certain rare circumstances the role will in this case be graphics-object. Investigate. | ||
- [src/features/svg/text-path.ts:10](packages/alfa-aria/src/features/svg/text-path.ts#L10): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/tspan.ts:10](packages/alfa-aria/src/features/svg/tspan.ts#L10): In certain rare circumstances the role will in this case be group. Investigate. | ||
- [src/features/svg/use.ts:10](packages/alfa-aria/src/features/svg/use.ts#L10): In certain rare circumstances the role will in this case be graphics-object. Investigate. | ||
|
||
### @bug | ||
|
||
- [src/features/svg/text-path.ts:11](packages/alfa-aria/src/features/svg/text-path.ts#L11): There is an open issue regarding the role mapping for textPath | ||
- [src/features/svg/tspan.ts:11](packages/alfa-aria/src/features/svg/tspan.ts#L11): There is an open issue regarding the role mapping for tspan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
const path = require("path"); | ||
const prettier = require("prettier"); | ||
const TypeScript = require("typescript"); | ||
|
||
const { readFile, writeFile } = require("./file-system"); | ||
const { getLineAtOffset, parseLines } = require("./text"); | ||
const { flatMap, groupBy, map } = require("./iterable"); | ||
const { Project } = require("../helpers/project"); | ||
|
||
/** | ||
* @typedef {import("./text").Line} Line | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} Todo | ||
* @property {string} file | ||
* @property {string} pkg | ||
* @property {TypeScript.TodoComment} comment | ||
*/ | ||
|
||
/** | ||
* @type {Array<TypeScript.TodoCommentDescriptor>} | ||
*/ | ||
const checks = [ | ||
{ text: "@todo", priority: 1 }, | ||
{ text: "@hack", priority: 1 }, | ||
{ text: "@bug", priority: 1 }, | ||
{ text: "@fixme", priority: 1 } | ||
]; | ||
|
||
/** | ||
* @param {string} file | ||
* @param {string} pkg | ||
* @param {Project} project | ||
* @return {Iterable<Todo>} | ||
*/ | ||
function getTodos(file, pkg, project) { | ||
return [...project.getTodos(file, checks)].map(comment => ({ | ||
file, | ||
pkg, | ||
comment | ||
})); | ||
} | ||
|
||
exports.getTodos = getTodos; | ||
|
||
/** | ||
* @param {string} file | ||
* @param {Iterable<Todo>} todos | ||
*/ | ||
function writeTodos(file, todos) { | ||
const todosByPackage = groupBy(todos, todo => todo.pkg); | ||
|
||
const contentByPackage = map(todosByPackage, ([pkg, todos]) => { | ||
const todosByFile = groupBy(todos, todo => todo.file); | ||
|
||
const contentByFile = flatMap(todosByFile, ([file, todos]) => { | ||
const lines = parseLines(readFile(file)); | ||
|
||
file = file.split(path.sep).join("/"); | ||
|
||
return map(todos, todo => { | ||
const line = getLineAtOffset(lines, todo.comment.position).index + 1; | ||
const message = todo.comment.message.substring( | ||
todo.comment.descriptor.text.length + 1 | ||
); | ||
const type = todo.comment.descriptor.text.toLowerCase(); | ||
const content = `* [${file.replace( | ||
`packages/${todo.pkg}/`, | ||
"" | ||
)}:${line}](${file}#L${line}): ${message}\n`; | ||
return { type, content }; | ||
}); | ||
}); | ||
|
||
const contentByTypeGrouped = groupBy(contentByFile, todo => todo.type); | ||
|
||
return { pkg, contentByTypeGrouped }; | ||
}); | ||
|
||
let content = ""; | ||
|
||
for (const item of contentByPackage) { | ||
content += `## [@siteimprove/${item.pkg}](packages/${item.pkg})\n`; | ||
|
||
for (const [type, todos] of item.contentByTypeGrouped) { | ||
content += `### ${type}\n`; | ||
|
||
for (const todo of todos) { | ||
content += todo.content; | ||
} | ||
|
||
content += "\n"; | ||
} | ||
} | ||
|
||
content = prettier.format(content, { | ||
parser: "markdown" | ||
}); | ||
|
||
writeFile(file, content); | ||
} | ||
|
||
exports.writeTodos = writeTodos; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters