mirror of
https://github.com/PeridexisErrant/DF-Walkthrough.git
synced 2025-09-21 21:30:47 +02:00
Better linting and travis CI again
This commit is contained in:
parent
9db16450c1
commit
cecba96841
7 changed files with 26 additions and 22 deletions
|
@ -3,7 +3,8 @@ python:
|
|||
- "2.7"
|
||||
- "3.4"
|
||||
- "3.5"
|
||||
install: pip install sphinx
|
||||
script:
|
||||
- pip install sphinx
|
||||
- python misc/lint.py
|
||||
- make html
|
||||
- make html
|
||||
sudo: false
|
|
@ -495,7 +495,7 @@ With the room set as a dormitory any dwarf without their own room will
|
|||
use the beds in the dormitory to sleep in. When you have a military, a
|
||||
:guilabel:`Barracks` is where dwarfs will spar and sleep when off duty.
|
||||
|
||||
Well done! We have a shared bedroom for our shorties to sleep in!
|
||||
Well done! We have a shared bedroom for our shorties to sleep in!
|
||||
|
||||
In the next chapter of the walkthrough, we’ll build a fine dining
|
||||
room, set up some more workshops, and start to build some proper living
|
||||
|
|
|
@ -31,7 +31,7 @@ up, reflect on what you learnt, and recite the motto: **Losing is Fun!**
|
|||
:numbered:
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
|
||||
chapters/*
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ and the Bay12 Forums will be your best friends.
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
|
||||
tutorials/*
|
||||
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
-o-border-radius: 0.2em; -ms-border-radius: 0.2em;
|
||||
-moz-box-shadow: 0.1em 0.2em 0.2em #ddd;
|
||||
-webkit-box-shadow: 0.1em 0.2em 0.2em #ddd;
|
||||
box-shadow: 0.1em 0.2em 0.2em #ddd;
|
||||
background-color: #f9f9f9;
|
||||
box-shadow: 0.1em 0.2em 0.2em #ddd;
|
||||
background-color: #f9f9f9;
|
||||
background-image: -moz-linear-gradient(top, #eee, #f9f9f9, #eee);
|
||||
background-image: -o-linear-gradient(top, #eee, #f9f9f9, #eee);
|
||||
background-image: -webkit-linear-gradient(top, #eee, #f9f9f9, #eee);
|
||||
|
|
|
@ -21,7 +21,7 @@ that would be much appreciated. I'm also very happy to take bug reports!
|
|||
You can `find the project on Github
|
||||
<https://github.com/PeridexisErrant/DF-Walkthrough>`_.
|
||||
|
||||
If this sounds like a lot of work - and it is - you can
|
||||
If this sounds like a lot of work - and it is - you can
|
||||
`support me on Patreon <https://www.patreon.com/PeridexisErrant>`_ instead.
|
||||
|
||||
|
||||
|
@ -99,7 +99,7 @@ Markup
|
|||
------
|
||||
Markup should be fairly minimal and let readers focus on the text.
|
||||
Basic markup helps with this, and should be used where appropriate.
|
||||
If in doubt, just match the surrounding sections.
|
||||
If in doubt, just match the surrounding sections.
|
||||
|
||||
Headings:
|
||||
|
||||
|
|
23
misc/lint.py
23
misc/lint.py
|
@ -4,12 +4,19 @@
|
|||
Any other automatic checks should be in this file too.
|
||||
"""
|
||||
|
||||
from io import open
|
||||
import os
|
||||
from os.path import *
|
||||
import sys
|
||||
|
||||
text_extensions = ('rst', 'md', 'txt', 'html', 'css', 'js')
|
||||
|
||||
|
||||
def error(fname, lineno, issue):
|
||||
"""Print the problem and location."""
|
||||
print('ERROR: {}:{} - {}'.format(fname, lineno+1, issue))
|
||||
|
||||
|
||||
def lint(path):
|
||||
"""Run linters on all files, print problem files."""
|
||||
print('Checking for tabs or trailing whitespace...')
|
||||
|
@ -21,19 +28,15 @@ def lint(path):
|
|||
fname.endswith(ext) for ext in text_extensions):
|
||||
continue
|
||||
with open(fname, encoding='utf-8') as fh:
|
||||
if '\t' in fh.read():
|
||||
failed = True
|
||||
print('ERROR: tabs found in {}'.format(fname))
|
||||
if any(line.replace('\n', '') != line.rstrip()
|
||||
for line in fh.readlines()):
|
||||
failed = True
|
||||
print('ERROR: trailing whitespace in {}'.format(fname))
|
||||
fh.seek(0)
|
||||
for i, line in enumerate(fh.readlines()):
|
||||
if len(line) > 81:
|
||||
failed = True
|
||||
print('ERROR: {}:{} - line too long'.format(
|
||||
fname, i + 1))
|
||||
error(fname, i, 'too long')
|
||||
if line.replace('\n', '') != line.rstrip():
|
||||
failed = True
|
||||
error(fname, i, 'trailing space')
|
||||
if '\t' in line:
|
||||
error(fname, i, 'contains tab')
|
||||
if failed:
|
||||
print('Use your text editor to convert tabs to spaces, wrap lines '
|
||||
'or trim trailing whitespace with minimal effort.')
|
||||
|
|
|
@ -62,7 +62,7 @@ some of the better articles for a background understanding.
|
|||
|
||||
.. epigraph::
|
||||
|
||||
Players are responsible for the cultivation and management of a
|
||||
Players are responsible for the cultivation and management of a
|
||||
virtual ecosystem — a colony of dwarves trying to build a thriving
|
||||
fortress in a randomly generated world. Dwarf Fortress unfolds as
|
||||
a series of staggeringly elaborate challenges and devastating
|
||||
|
@ -74,8 +74,8 @@ some of the better articles for a background understanding.
|
|||
facade is a dizzying array of moving parts, algorithms that model
|
||||
everything from dwarves’ personalities (some are depressive; many
|
||||
appreciate art) to the climate and economic patterns of the
|
||||
simulated world. ...
|
||||
|
||||
simulated world. ...
|
||||
|
||||
-- `The NY Times Magazine <http://www.nytimes.com/2011/07/24/magazine/
|
||||
the-brilliance-of-dwarf-fortress.html?_r=2&pagewanted=all>`_
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue