MetaMask / module-lint

Analyzes one or more repos for divergence from a template repo.
1 stars 3 forks source link

Complete automated module-lint report generation so we can start using it #82

Open kanthesha opened 2 months ago

kanthesha commented 2 months ago

60 added the ability to run this tool on an interval and report results to Slack for each failing repository. However, to be able to report results in our Slack channel, we need to go further.

Acceptance Criteria

Resources

See below on what the Slack messages could look like.

mcmire commented 2 months ago

~Note that the majority of this ticket would be solved via #83. That is, once we have the ability to get the report from a lint run in JSON format, then we can simply calculate a percentage based on the number of passing rules divided by the total number of rules that were run.~ I've updated the PR description with more details, so this is no longer the case.

mcmire commented 1 month ago

For the opening message, we can say something like:

๐Ÿ“ฆ A new package standardization report is available. Your team has 4 repositories that require maintenance in order to align with the module template. This is important for maintaining conventions across MetaMask and adhering to our security principles. Read more about this alert, or open this thread to view more details and take action: ๐Ÿงต ๐Ÿ‘‰๐Ÿป

or, if, all projects pass:

๐Ÿ“ฆ A new package standardization report is available. Great work! Your team has 5 repositories that fully align with the module template. Open this thread to view more details: ๐Ÿงต ๐Ÿ‘‰๐Ÿป

(The "Read more about this alert" link could go to documentation that explains what to do. The ticket for this is in #85.)

Each message in the thread could represent a repo, and could spit out a similar representation of the output we see in the terminal. For instance:

MetaMask/utils:

18 standardization checks were performed on this repo. 9 passed, 8 failed, and 1 encountered an error:

[โœ”๏ธŽ] Is the classic Yarn config file (.yarnrc) absent?

[โœ˜] Does the package have a well-formed manifest (package.json)?

  • Invalid package.json: Invalid import (Expected a string, but received: [object Object]); Invalid require (Expected a string, but received: [object Object]).

[โœ”๏ธŽ] Is README.md present?

[โœ”๏ธŽ] Does the README conform by recommending the correct Yarn version to install?

[โœ˜] Does the README conform by recommending node install from nodejs.org?

  • README.md should contain "Install the current LTS version of Node.js", but does not.

[โœ˜] Are all of the files for Yarn Modern present, and do they conform?

  • .yarnrc.yml does not match the same file in the template repo.
  • .yarn/releases/yarn-4.1.1.cjs does not exist in this project.
  • .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs does not match the same file in the template repo.

[โœ”๏ธŽ] Does the src/ directory exist?

[โœ˜] Is .nvmrc present, and does it conform?

  • .nvmrc does not match the same file in the template repo.

[โœ˜] Is jest.config.js present, and does it conform?

  • jest.config.js does not match the same file in the template repo.

[โœ˜] Is tsconfig.json present, and does it conform?

  • tsconfig.json does not match the same file in the template repo.

[โœ˜] Is tsconfig.build.json present, and does it conform?

  • tsconfig.build.json does not match the same file in the template repo.

[โœ˜] Is tsup.config.ts present, and does it conform?

  • tsup.config.ts does not exist in this project.

[โœ”๏ธŽ] Is typedoc.json present, and does it conform?

[โœ”๏ธŽ] Is CHANGELOG.md present?

[?] Is CHANGELOG.md well-formatted?

  • ERROR: Tried to get version from package manifest in order to validate changelog, but manifest is not well-formed (Invalid import (Expected a string, but received: [object Object]); Invalid require (Expected a string, but received: [object Object]).).

[โœ”๏ธŽ] Is .editorconfig present, and does it conform?

[โœ”๏ธŽ] Is .gitattributes present, and does it conform?

[โœ”๏ธŽ] Is .gitignore present, and does it conform?