Skip to content
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

feat: update dependencies and switch to using canon repolinter #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 4 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,8 @@
ARG RUNTIME_DEPS="git libicu-dev perl"
ARG BUILD_DEPS="make build-essential cmake pkg-config zlib1g-dev libcurl4-openssl-dev libssl-dev libldap2-dev libidn11-dev"
FROM ghcr.io/todogroup/repolinter:v0.11.1

FROM ruby:2.6-slim as ruby-deps
ARG RUNTIME_DEPS
ARG BUILD_DEPS

# set to always UTF8
ENV LANG=C.UTF-8

# Install build deps
RUN apt-get update && \
apt-get install --no-install-recommends -y $RUNTIME_DEPS $BUILD_DEPS && \
gem update --system --silent

# Install ruby gems
WORKDIR /app
COPY Gemfile* ./
RUN bundle config path vendor/bundle && \
bundle install --jobs 4 --retry 3

# cleanup
RUN apt-get remove -y $BUILD_DEPS && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

FROM python:2.7-slim as python-deps

# docutils for github-markup
RUN python -m pip install --upgrade pip && \
pip install docutils

FROM node:lts-slim

# Copy Ruby dependencies
COPY --from=ruby-deps / /
COPY --from=python-deps / /

# Install node_modules
WORKDIR /app
COPY package*.json ./
RUN npm install --production

# move the rest of the project over
# copy repolinter-action
WORKDIR /repolinter-action
COPY dist dist

# Configure bundler
ENV BUNDLE_GEMFILE=/app/Gemfile
ENV BUNDLE_PATH=/app/vendor/bundle

# Working directory will automagically be set to github workspace when the container is executed
ENTRYPOINT ["bundle", "exec", "node /app/dist/index.js"]
ENTRYPOINT ["bundle", "exec", "node /repolinter-action/dist/index.js"]
252 changes: 231 additions & 21 deletions THIRD_PARTY_NOTICES.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions __tests__/getConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('getConfig', () => {

test('getConfig returns a config from a YAML', async () => {
const filepath = path.resolve(__dirname, 'testconfig.yaml')
const expected = yaml.safeLoad(
const expected = yaml.load(
await fs.promises.readFile(filepath, 'utf8')
) as Record<string, unknown>
const res = await getConfig({configFile: filepath})
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('getConfig', () => {
const url =
'https://raw.githubusercontent.com/aperture-science-incorporated/.github/master/repolinter.yaml'
const filepath = path.resolve(__dirname, 'testconfig.yaml')
const expected = yaml.safeLoad(
const expected = yaml.load(
await fs.promises.readFile(filepath, 'utf8')
) as Record<string, unknown>
const scope = nock('https://raw.githubusercontent.com')
Expand Down
68 changes: 68 additions & 0 deletions dist/error.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
body {
margin: 0;
padding: 80px 100px;
font: 13px "Helvetica Neue", "Lucida Grande", "Arial";
background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9));
background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9);
background-repeat: no-repeat;
color: #555;
-webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
margin: 0;
font-size: 22px;
color: #343434;
}
h1 em, h2 em {
padding: 0 5px;
font-weight: normal;
}
h1 {
font-size: 60px;
}
h2 {
margin-top: 10px;
}
h3 {
margin: 5px 0 10px 0;
padding-bottom: 5px;
border-bottom: 1px solid #eee;
font-size: 18px;
}
ul {
margin: 0;
padding: 0;
}
ul li {
margin: 5px 0;
padding: 3px 8px;
list-style: none;
}
ul li:hover {
cursor: pointer;
color: #2e2e2e;
}
ul li .path {
padding-left: 5px;
font-weight: bold;
}
ul li .line {
padding-right: 5px;
font-style: italic;
}
ul li:first-child .path {
padding-left: 0;
}
p {
line-height: 1.5;
}
a {
color: #555;
text-decoration: none;
}
a:hover {
color: #303030;
}
#stacktrace {
margin-top: 15px;
}
15 changes: 15 additions & 0 deletions dist/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<title>{error}</title>
<style>{style}</style>
</head>
<body>
<div id="wrapper">
<h1>{title}</h1>
<h2><em>{statusCode}</em> {error}</h2>
{explanation}
{response}
<ul id="stacktrace">{stack}</ul>
</div>
</body>
</html>
491 changes: 490 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/regexps.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/rules/file-contents-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"content": { "type": "string" },
"flags": { "type": "string" },
"human-readable-content": { "type": "string" },
"fail-on-non-exist": {
"fail-on-non-existent": {
"type": "boolean",
"default": false
}
Expand Down
2 changes: 1 addition & 1 deletion dist/rules/file-not-contents-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"content": { "type": "string" },
"flags": { "type": "string" },
"human-readable-content": { "type": "string" },
"fail-on-non-exist": {
"fail-on-non-existent": {
"type": "boolean",
"default": false
}
Expand Down
4 changes: 4 additions & 0 deletions dist/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"properties": {
"$schema": { "type": "string" },
"version": { "const": 2 },
"extends": {
"type": "string",
"title": "URL or path of ruleset file this ruleset extends"
},
"axioms": {
"type": "object",
"title": "The axioms schema",
Expand Down
Loading