Skip to content

feat(utils): implement report.md formatting - #196

Merged
MishaSeredenkoPushBased merged 16 commits into
mainfrom
implement-report-md-formatting
Nov 6, 2023
Merged

feat(utils): implement report.md formatting#196
MishaSeredenkoPushBased merged 16 commits into
mainfrom
implement-report-md-formatting

Conversation

@MishaSeredenkoPushBased

Copy link
Copy Markdown
Contributor

Implemented the changes for the report.md file.
Added the following sections: Overview, Categories, Audits, About.
Note that the commit data at About section is in the scope of the task #192
Here's the example of the audit of our test react-todos-app, generated by nx run-collect cli:

Code PushUp Report

🏷 Category⭐ Score🛡 Audits
Bug prevention68 🟡16
Code style54 🟡13

🏷 Categories

🟡 Bug prevention: 68

🟡 Code style: 54

🛡️ Audits

Disallow assignment operators in conditional expressions (ESLint)

🟩 0 (score: 100) No details

Disallow reassigning const variables (ESLint)

🟩 0 (score: 100) No details

Disallow the use of debugger (ESLint)

🟩 0 (score: 100) No details

Disallow invalid regular expression strings in RegExp constructors (ESLint)

🟩 0 (score: 100) No details

Disallow the use of undeclared variables unless mentioned in /*global */ comments (ESLint)

🟩 0 (score: 100) No details

Disallow loops with a body that allows only one iteration (ESLint)

🟩 0 (score: 100) No details

Disallow negating the left operand of relational operators (ESLint)

🟩 0 (score: 100) No details

Disallow use of optional chaining in contexts where the undefined value is not allowed (ESLint)

🟩 0 (score: 100) No details

Disallow unused variables (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warning'loading' is assigned a value but never used.src/App.jsx8

ESLint rule no-unused-vars. 📖 Docs

Require calls to isNaN() when checking for NaN (ESLint)

🟩 0 (score: 100) No details

Enforce comparing typeof expressions against valid strings (ESLint)

🟩 0 (score: 100) No details

Require braces around arrow function bodies (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningUnexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.src/components/TodoFilter.jsx3

ESLint rule arrow-body-style. 📖 Docs

Enforce camelcase naming convention (ESLint)

🟩 0 (score: 100) No details

Enforce consistent brace style for all control statements (ESLint)

🟩 0 (score: 100) No details

Require the use of === and !== (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningExpected '===' and instead saw '=='.src/hooks/useTodos.js41

ESLint rule eqeqeq. 📖 Docs

Enforce a maximum number of lines of code in a function (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningArrow function has too many lines (71). Maximum allowed is 50.src/hooks/useTodos.js3

ESLint rule max-lines-per-function. 📖 Docs

Enforce a maximum number of lines per file (ESLint)

🟩 0 (score: 100) No details

Disallow variable declarations from shadowing variables declared in the outer scope (ESLint)

🟥 3 warnings (score: 0)
SeverityMessageSource fileLine(s)
⚠️warning'data' is already declared in the upper scope on line 5 column 10.src/hooks/useTodos.js11
⚠️warning'data' is already declared in the upper scope on line 5 column 10.src/hooks/useTodos.js29
⚠️warning'data' is already declared in the upper scope on line 5 column 10.src/hooks/useTodos.js41

ESLint rule no-shadow. 📖 Docs

Require let or const instead of var (ESLint)

🟩 0 (score: 100) No details

Require or disallow method and property shorthand syntax for object literals (ESLint)

🟥 3 warnings (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningExpected property shorthand.src/hooks/useTodos.js19
⚠️warningExpected property shorthand.src/hooks/useTodos.js32
⚠️warningExpected property shorthand.src/hooks/useTodos.js33

ESLint rule object-shorthand. 📖 Docs

Require using arrow functions for callbacks (ESLint)

🟩 0 (score: 100) No details

Require const declarations for variables that are never reassigned after declared (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warning'root' is never reassigned. Use 'const' instead.src/index.jsx5

ESLint rule prefer-const. 📖 Docs

Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead (ESLint)

🟩 0 (score: 100) No details

Require or disallow "Yoda" conditions (ESLint)

🟩 0 (score: 100) No details

Disallow missing key props in iterators/collection literals (ESLint)

🟥 1 warning (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningMissing "key" prop for element in iteratorsrc/components/TodoList.jsx7

ESLint rule jsx-key, from react plugin. 📖 Docs

Disallow missing props validation in a React component definition (ESLint)

🟥 6 warnings (score: 0)
SeverityMessageSource fileLine(s)
⚠️warning'onCreate' is missing in props validationsrc/components/CreateTodo.jsx15
⚠️warning'setQuery' is missing in props validationsrc/components/TodoFilter.jsx10
⚠️warning'setHideComplete' is missing in props validationsrc/components/TodoFilter.jsx18
⚠️warning'todos' is missing in props validationsrc/components/TodoList.jsx6
⚠️warning'todos.map' is missing in props validationsrc/components/TodoList.jsx6
⚠️warning'onEdit' is missing in props validationsrc/components/TodoList.jsx13

ESLint rule prop-types, from react plugin. 📖 Docs

Disallow missing React when using JSX (ESLint)

🟩 0 (score: 100) No details

enforces the Rules of Hooks (ESLint)

🟩 0 (score: 100) No details

verifies the list of dependencies for Hooks like useEffect and similar (ESLint)

🟥 2 warnings (score: 0)
SeverityMessageSource fileLine(s)
⚠️warningReact Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?src/hooks/useTodos.js17
⚠️warningReact Hook useCallback does nothing when called with only one argument. Did you forget to pass an array of dependencies?src/hooks/useTodos.js40

ESLint rule exhaustive-deps, from react-hooks plugin. 📖 Docs

Disallow missing displayName in a React component definition (ESLint)

🟩 0 (score: 100) No details

Disallow comments from being inserted as text nodes (ESLint)

🟩 0 (score: 100) No details

Disallow duplicate properties in JSX (ESLint)

🟩 0 (score: 100) No details

Disallow target="_blank" attribute without rel="noreferrer" (ESLint)

🟩 0 (score: 100) No details

Disallow undeclared variables in JSX (ESLint)

🟩 0 (score: 100) No details

Disallow React to be incorrectly marked as unused (ESLint)

🟩 0 (score: 100) No details

Disallow variables used in JSX to be incorrectly marked as unused (ESLint)

🟩 0 (score: 100) No details

Disallow passing of children as props (ESLint)

🟩 0 (score: 100) No details

Disallow when a DOM element is using both children and dangerouslySetInnerHTML (ESLint)

🟩 0 (score: 100) No details

Disallow usage of deprecated methods (ESLint)

🟩 0 (score: 100) No details

Disallow direct mutation of this.state (ESLint)

🟩 0 (score: 100) No details

Disallow usage of findDOMNode (ESLint)

🟩 0 (score: 100) No details

Disallow usage of isMounted (ESLint)

🟩 0 (score: 100) No details

Disallow usage of the return value of ReactDOM.render (ESLint)

🟩 0 (score: 100) No details

Disallow using string references (ESLint)

🟩 0 (score: 100) No details

Disallow unescaped HTML entities from appearing in markup (ESLint)

🟩 0 (score: 100) No details

Disallow usage of unknown DOM property (ESLint)

🟩 0 (score: 100) No details

Enforce ES5 or ES6 class for returning value in render function (ESLint)

🟩 0 (score: 100) No details

About

Report was created by Code PushUp on Thu Nov 02 2023 12:02:52 GMT+0100 (Central European Standard Time)

CommitVersionDurationPluginsCategoriesAudits
Implement todos list (3ac01d1)0.0.10.31 s1247

The following plugins were run:

PluginAuditsVersionDuration
ESLint470.0.10.31 s

Made with ❤️ by code-pushup.dev

@MishaSeredenkoPushBasedMishaSeredenkoPushBased added 🔬 testing writing tests ➕ enhancement new feature or request 🤓 UX UX improvement for CLI users labels Nov 2, 2023
BioPhoton
BioPhoton previously requested changes Nov 2, 2023

@BioPhotonBioPhoton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small things I found:
image
No collapse for empty results
image
Linebreak

@matejchalkmatejchalk linked an issue Nov 2, 2023 that may be closed by this pull request
52 tasks
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/report-to-md.ts
Comment threadpackages/utils/src/lib/report-to-md.ts Outdated
Comment threadpackages/utils/src/lib/report-to-md.ts Outdated
Comment threadpackages/utils/src/lib/report-to-md.ts Outdated
Comment threadpackages/models/src/lib/implementation/schemas.ts Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/report-to-md.ts
@MishaSeredenkoPushBased

MishaSeredenkoPushBased commented Nov 3, 2023

Copy link
Copy Markdown
ContributorAuthor

Small things I found: No collapse for empty results

@BioPhoton Already fixed while fixing the comments of @matejchalk

@matejchalkmatejchalk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some minor things, but overall this is looking fantastic, great job 👏

Comment threadpackages/utils/src/lib/__snapshots__/report-to-md.spec.ts.snap Outdated
Comment threadpackages/utils/src/lib/report-to-md.ts Outdated
@MishaSeredenkoPushBased
MishaSeredenkoPushBased deleted the implement-report-md-formatting branch November 6, 2023 11:07
@matejchalkmatejchalk mentioned this pull request Nov 6, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

➕ enhancementnew feature or request🔬 testingwriting tests🧩 utils🤓 UXUX improvement for CLI users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement report.md formatting

4 participants

@MishaSeredenkoPushBased@Tlacenka@BioPhoton@matejchalk