enforce spell checking on CI

This commit is contained in:
arvidn 2017-06-18 14:39:10 -04:00 committed by Arvid Norberg
parent 53cbb607d0
commit f04d729d43
19 changed files with 69 additions and 34 deletions

View File

@ -54,7 +54,7 @@ before_install:
echo ''import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")'' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth;
easy_install --user Pygments;
easy_install --user aafigure;
brew install --quiet graphviz;
brew install --quiet graphviz hunspell;
easy_install --user Pillow;
fi'
@ -96,7 +96,7 @@ install:
script:
# disable invoking docutils for now, until we can have a modern version of it
- cd docs
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "osx" ]]; then make RST2HTML=/Users/travis/Library/Python/2.7/bin/rst2html.py AAFIGURE=echo; fi
- if [[ $docs == "1" && $TRAVIS_OS_NAME == "osx" ]]; then make spell-check RST2HTML=/Users/travis/Library/Python/2.7/bin/rst2html.py AAFIGURE=echo; fi
- cd ..
- cd test

View File

@ -66,7 +66,7 @@ are mandatory. However, RSS items will be used as examples in this BEP::
+---------+
The ``next`` pointer is at least 20 byte ID in the DHT key space pointing to where the next
item in the list is announced. The list is terminated with an ID of all zeroes.
item in the list is announced. The list is terminated with an ID of all zeros.
The ID an items is announced to is determined by the SHA1 hash of the bencoded representation
of the item iteself. This contains all fields in the item, except the signature.

View File

@ -11,12 +11,14 @@ BEP
bdecode
bdecoded
bencode
bencoding
bencoded
int64
uint64
enum
enums
struct
structs
bool
realloc
merkle
@ -44,7 +46,8 @@ DHT
adler32
LRU
UPnP
NAT-PMP
NAT
PMP
Arvid
Norberg
RTT
@ -154,3 +157,33 @@ v4
v6
upnp
x509
process'
crc32
mtime
fallback
accessor
utf
str
bw
trackerid
timestamp
prioritisation
filehash
len
partfile
prepended
vec
dir
ut
ih
ec
cb
cid
mj
prio
src
'put'
'mtime'
'fingerprints'
'query'
'ro'

View File

@ -99,8 +99,9 @@ endif
$(REFERENCE_TARGETS:=.rst) plain_text_out.txt:gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py --plain-output
spell:plain_text_out.txt
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -l plain_text_out.txt
spell-check:plain_text_out.txt
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -l plain_text_out.txt >hunspell-report.txt
@if [ -s hunspell-report.txt ]; then echo 'spellcheck failed, fix words or add to dictionary:'; cat hunspell-report.txt; false; fi;
%.epub:%.rst
rst2epub --exit-status=2 $? $@

View File

@ -62,7 +62,7 @@ how to find out about it and what to do about it.
Make sure to keep track of the paused state, the error state and the upload
mode of your torrents. By default, torrents are auto-managed, which means
libtorrent will pause them, unpause them, scrape them and take them out
libtorrent will pause, resume, scrape them and take them out
of upload-mode automatically.
Whenever a torrent encounters a fatal error, it will be stopped, and the

View File

@ -1912,7 +1912,7 @@ int main(int argc, char* argv[])
"[q] quit client [m] add magnet link\n"
"\n"
"TORRENT ACTIONS\n"
"[p] pause/unpause selected torrent [C] toggle disk cache\n"
"[p] pause/resume selected torrent [C] toggle disk cache\n"
"[s] toggle sequential download [j] force recheck\n"
"[space] toggle session pause [c] clear error\n"
"[v] scrape [D] delete torrent and data\n"

View File

@ -1444,7 +1444,7 @@ namespace libtorrent
private:
// TODO: 2 should the alert baseclass have this object instead?
// TODO: 2 should the alert base class have this object instead?
aux::stack_allocator const& m_alloc;
int m_log_idx;
@ -2007,7 +2007,7 @@ namespace libtorrent
virtual std::string message() const TORRENT_OVERRIDE;
// the target hash of the immutable item. This must
// match the sha-1 hash of the bencoded form of ``item``.
// match the SHA-1 hash of the bencoded form of ``item``.
sha1_hash target;
// the data for this item

View File

@ -339,7 +339,7 @@ struct TORRENT_EXPORT bdecode_node
// Swap contents.
void swap(bdecode_node& n);
// pre-allocate memory for the specified numbers of tokens. This is
// preallocate memory for the specified numbers of tokens. This is
// useful if you know approximately how many tokens are in the file
// you are about to parse. Doing so will save realloc operations
// while parsing. You should only call this on the root node, before

View File

@ -111,7 +111,7 @@ namespace libtorrent
partial_hash(): offset(0) {}
// the number of bytes in the piece that has been hashed
int offset;
// the sha-1 context
// the SHA-1 context
hasher h;
};

View File

@ -355,7 +355,7 @@ namespace libtorrent
// this is used when creating a torrent. If there's
// only one file there are cases where it's impossible
// to know if it should be written as a multifile torrent
// to know if it should be written as a multi-file torrent
// or not. e.g. test/test there's one file and one directory
// and they have the same name.
bool m_multifile:1;

View File

@ -312,12 +312,12 @@ namespace libtorrent
// easy for plugins to do timed events, for sending messages or whatever.
virtual void tick() {}
// These hooks are called when the torrent is paused and unpaused respectively.
// These hooks are called when the torrent is paused and resumed respectively.
// The return value indicates if the event was handled. A return value of
// ``true`` indicates that it was handled, and no other plugin after this one
// will have this hook function called, and the standard handler will also not be
// invoked. So, returning true effectively overrides the standard behavior of
// pause or unpause.
// pause or resume.
//
// Note that if you call ``pause()`` or ``resume()`` on the torrent from your
// handler it will recurse back into your handler, so in order to invoke the
@ -400,16 +400,16 @@ namespace libtorrent
// throwing an exception from any of the handlers (except add_handshake)
// closes the connection
// this is called when the initial BT handshake is received. Returning false
// means that the other end doesn't support this extension and will remove
// it from the list of plugins.
// this is not called for web seeds
// this is called when the initial bittorrent handshake is received.
// Returning false means that the other end doesn't support this extension
// and will remove it from the list of plugins. this is not called for web
// seeds
virtual bool on_handshake(char const* /*reserved_bits*/) { return true; }
// called when the extension handshake from the other end is received
// if this returns false, it means that this extension isn't
// supported by this peer. It will result in this peer_plugin
// being removed from the peer_connection and destructed.
// being removed from the peer_connection and destructed.
// this is not called for web seeds
virtual bool on_extension_handshake(bdecode_node const&) { return true; }

View File

@ -144,7 +144,7 @@ namespace libtorrent
};
// maps storage pointer, file index pairs to the
// lru entry for the file
// LRU entry for the file
typedef std::map<std::pair<void*, int>, lru_file_entry> file_set;
file_set m_files;

View File

@ -92,7 +92,7 @@ namespace libtorrent
// the modification time of this file specified in posix time.
std::time_t mtime;
// a sha-1 hash of the content of the file, or zeros, if no
// a SHA-1 hash of the content of the file, or zeros, if no
// file hash was present in the torrent file. It can be used to potentially
// find alternative sources for the file.
sha1_hash filehash;
@ -458,7 +458,7 @@ namespace libtorrent
// These functions are used to query attributes of files at
// a given index.
//
// The ``hash()`` is a sha-1 hash of the file, or 0 if none was
// The ``hash()`` is a SHA-1 hash of the file, or 0 if none was
// provided in the torrent file. This can potentially be used to
// join a bittorrent network with other file sharing networks.
//
@ -634,7 +634,7 @@ namespace libtorrent
// all unique paths files have. The internal_file_entry::path_index
// points into this array. The paths don't include the root directory
// name for multi-file torrents. The m_name field need to be
// pre-pended to these paths, and the filename of a specific file
// prepended to these paths, and the filename of a specific file
// entry appended, to form full file paths
std::vector<std::string> m_paths;

View File

@ -331,7 +331,7 @@ namespace libtorrent
int receive_quota;
// an estimated round trip time to this peer, in milliseconds. It is
// estimated by timing the the tcp ``connect()``. It may be 0 for
// estimated by timing the the TCP ``connect()``. It may be 0 for
// incoming connections.
int rtt;

View File

@ -166,8 +166,8 @@ namespace libtorrent
// settings_pack object. Its settings will take effect before the session
// starts up.
//
// The ``flags`` parameter can be used to start default features (upnp &
// nat-pmp) and default plugins (ut_metadata, ut_pex and smart_ban). The
// The ``flags`` parameter can be used to start default features (UPnP &
// NAT-PMP) and default plugins (ut_metadata, ut_pex and smart_ban). The
// default is to start those features. If you do not want them to start,
// pass 0 as the flags parameter.
session(settings_pack const& pack = settings_pack()

View File

@ -407,7 +407,7 @@ namespace libtorrent
// store the given bencoded data as an immutable item in the DHT.
// the returned hash is the key that is to be used to look the item
// up again. It's just the sha-1 hash of the bencoded form of the
// up again. It's just the SHA-1 hash of the bencoded form of the
// structure.
sha1_hash dht_put_item(entry data);
@ -444,7 +444,7 @@ namespace libtorrent
// it is critical to not perform any blocking operations. Ideally not
// even locking a mutex. Pass any data required for this function along
// with the function object's context and make the function entirely
// self-contained. The only reason data blobs' values are computed
// self-contained. The only reason data blob's value is computed
// via a function instead of just passing in the new value is to avoid
// race conditions. If you want to *update* the value in the DHT, you
// must first retrieve it, then modify it, then write it back. The way
@ -671,7 +671,7 @@ namespace libtorrent
void set_peer_class_type_filter(peer_class_type_filter const& f);
// Creates a new peer class (see peer-classes_) with the given name. The
// returned integer is the new peer class' identifier. Peer classes may
// returned integer is the new peer class identifier. Peer classes may
// have the same name, so each invocation of this function creates a new
// class and returns a unique identifier.
//

View File

@ -121,7 +121,7 @@ namespace libtorrent
char const* data() const { return reinterpret_cast<char const*>(&m_number[0]); }
char* data() { return reinterpret_cast<char*>(&m_number[0]); }
// set the sha1-hash to all zeroes.
// set the sha1-hash to all zeros.
void clear() { std::memset(m_number, 0, size); }
// return true if the sha1-hash is all zero.

View File

@ -352,8 +352,9 @@ namespace libtorrent
file_entry file_at(int index) const { return m_files.at_deprecated(index); }
#endif // TORRENT_NO_DEPRECATE
// If you need index-access to files you can use the ``num_files()`` and
// ``file_path()`` et.al. to access files using indices.
// If you need index-access to files you can use the ``num_files()`` along
// with the ``file_path()``, ``file_size()``-family of functions to access
// files using indices.
int num_files() const { return m_files.num_files(); }
// This function will map a piece index, a byte offset within that piece

View File

@ -1225,7 +1225,7 @@ namespace libtorrent
}
TORRENT_ASSERT(!files.name().empty());
// extract sha-1 hashes for all pieces
// extract SHA-1 hashes for all pieces
// we want this division to round upwards, that's why we have the
// extra addition