mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Merge pull request #688 from arkhi/ci
Add .editorconfig files and global linting Github Workflow.
This commit is contained in:
commit
014c2f108b
16 changed files with 383 additions and 302 deletions
31
.editorconfig
Normal file
31
.editorconfig
Normal file
|
@ -0,0 +1,31 @@
|
|||
# @see https://editorconfig.org/
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
max_line_length = 100
|
||||
|
||||
# C-style doc comments
|
||||
block_comment_start = /*
|
||||
block_comment = *
|
||||
block_comment_end = */
|
||||
|
||||
[{bw-dev,fr-dev,LICENSE}]
|
||||
max_line_length = off
|
||||
|
||||
[*.{csv,json,html,md,po,py,svg,tsv}]
|
||||
max_line_length = off
|
||||
|
||||
[*.{md,markdown}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
max_line_length = off
|
2
.github/workflows/black.yml
vendored
2
.github/workflows/black.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Lint
|
||||
name: Lint Python
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
|
|
21
.github/workflows/linters-global.yaml
vendored
Normal file
21
.github/workflows/linters-global.yaml
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
name: Lint Project
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, ci ]
|
||||
pull_request:
|
||||
branches: [ main, ci ]
|
||||
|
||||
jobs:
|
||||
linters:
|
||||
name: linters
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: EditorConfig
|
||||
uses: greut/eclint-action@v0
|
18
README.md
18
README.md
|
@ -158,6 +158,24 @@ The `production` branch of BookWyrm contains a number of tools not on the `main`
|
|||
|
||||
Instructions for running BookWyrm in production:
|
||||
|
||||
- Get the application code:
|
||||
`git clone git@github.com:mouse-reeve/bookwyrm.git`
|
||||
- Switch to the `production` branch
|
||||
`git checkout production`
|
||||
- Create your environment variables file
|
||||
`cp .env.example .env`
|
||||
- Add your domain, email address, SMTP credentials
|
||||
- Set a secure redis password and secret key
|
||||
- Set a secure database password for postgres
|
||||
- Update your nginx configuration in `nginx/default.conf`
|
||||
- Replace `your-domain.com` with your domain name
|
||||
- Run the application (this should also set up a Certbot ssl cert for your domain) with
|
||||
`docker-compose up --build`, and make sure all the images build successfully
|
||||
- When docker has built successfully, stop the process with `CTRL-C`
|
||||
- Comment out the `command: certonly...` line in `docker-compose.yml`
|
||||
- Run docker-compose in the background with: `docker-compose up -d`
|
||||
- Initialize the database with: `./bw-dev initdb`
|
||||
- Set up schedule backups with cron that runs that `docker-compose exec db pg_dump -U <databasename>` and saves the backup to a safe location
|
||||
- Get the application code:
|
||||
`git clone git@github.com:mouse-reeve/bookwyrm.git`
|
||||
- Switch to the `production` branch
|
||||
|
|
4
bookwyrm/static/css/fonts/.editorconfig
Normal file
4
bookwyrm/static/css/fonts/.editorconfig
Normal file
|
@ -0,0 +1,4 @@
|
|||
# @see https://editorconfig.org/
|
||||
|
||||
[*.svg]
|
||||
insert_final_newline = unset
|
|
@ -59,7 +59,9 @@ class TabGroup {
|
|||
}
|
||||
|
||||
initPanels() {
|
||||
let selectedPanelId = this.tablist.querySelector('[role="tab"][aria-selected="true"]').getAttribute("aria-controls");
|
||||
let selectedPanelId = this.tablist
|
||||
.querySelector('[role="tab"][aria-selected="true"]')
|
||||
.getAttribute("aria-controls");
|
||||
for(let panel of this.panels) {
|
||||
if(panel.getAttribute("id") !== selectedPanelId) {
|
||||
panel.setAttribute("hidden", "");
|
||||
|
|
|
@ -7,9 +7,14 @@
|
|||
<div class="field has-addons mb-0">
|
||||
<div class="control">
|
||||
<input
|
||||
class="input is-small"
|
||||
type="number"
|
||||
name="progress"
|
||||
value="{{ readthrough.progress|default:'' }}"
|
||||
min="0"
|
||||
size="3"
|
||||
aria-label="{% if readthrough.progress_mode == 'PG' %}Current page{% else %}Percent read{% endif %}"
|
||||
class="input is-small" type="number" min="0"
|
||||
name="progress" size="3" value="{{ readthrough.progress|default:'' }}">
|
||||
/>
|
||||
</div>
|
||||
<div class="control select is-small">
|
||||
<select name="progress_mode" aria-label="Progress mode">
|
||||
|
|
Loading…
Reference in a new issue