Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mirador-video-annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Loïs Poujade
mirador-video-annotations
Commits
0120d4dc
Commit
0120d4dc
authored
4 years ago
by
Jack Reed
Committed by
Chris Beer
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a container-lint process for inspecting all of the containers
parent
422509da
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+2
-1
2 additions, 1 deletion
package.json
scripts/container-lint.js
+18
-0
18 additions, 0 deletions
scripts/container-lint.js
with
20 additions
and
1 deletion
package.json
+
2
−
1
View file @
0120d4dc
...
...
@@ -10,7 +10,8 @@
"sideEffects"
:
false
,
"scripts"
:
{
"clean"
:
"rm -rf ./dist"
,
"lint"
:
"node_modules/.bin/eslint ./ && npm run lint:translations"
,
"lint"
:
"node_modules/.bin/eslint ./ && npm run lint:translations && npm run lint:containers"
,
"lint:containers"
:
"node ./scripts/container-lint.js"
,
"lint:translations"
:
"node ./scripts/i18n-lint.js"
,
"server"
:
"node_modules/.bin/http-server --cors"
,
"test"
:
"npm run build && npm run lint && npm run size && jest -c jest.json"
,
...
...
This diff is collapsed.
Click to expand it.
scripts/container-lint.js
0 → 100644
+
18
−
0
View file @
0120d4dc
const
glob
=
require
(
'
glob
'
);
// eslint-disable-line import/no-extraneous-dependencies
const
fs
=
require
(
'
fs
'
);
const
chalk
=
require
(
'
chalk
'
);
// eslint-disable-line import/no-extraneous-dependencies
const
{
error
}
=
console
;
const
globOpts
=
{
cwd
:
'
src/containers
'
};
const
files
=
glob
.
sync
(
'
**/*.js
'
,
globOpts
);
files
.
forEach
((
fileName
)
=>
{
const
fileContent
=
fs
.
readFileSync
(
`src/containers/
${
fileName
}
`
).
toString
();
const
withPlugins
=
fileContent
.
indexOf
(
'
withPlugins(
'
);
if
(
withPlugins
>
0
)
{
const
correctCall
=
fileContent
.
indexOf
(
`withPlugins('
${
fileName
.
replace
(
'
.js
'
,
''
)}
')`
);
if
(
withPlugins
!==
correctCall
)
{
error
(
chalk
.
red
(
`Check withPlugins for
${
fileName
}
for an incorrect target`
));
}
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment