Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sahib/rmlint
Browse files Browse the repository at this point in the history
  • Loading branch information
sahib committed Jan 22, 2021
2 parents 09de648 + 6abfba9 commit 80d465c
Show file tree
Hide file tree
Showing 33 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Nothing was removed.
- Progressbar uses timeout-based redraws which leads to much smoother drawing
and less cpu footprint.
- ``pretty`` formatter (default) produces now valid escaped commands.
It is still intented for visual output only. That's why a note for this was
It is still intended for visual output only. That's why a note for this was
added.

### Added
Expand Down
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def check_gettext(context):
def check_fiemap(context):
rc = 1

if GetOption('with_gettext') is False:
if GetOption('with_fiemap') is False:
rc = 0

if rc and tests.CheckType(context, 'struct fiemap', header='#include <linux/fiemap.h>\n'):
Expand Down Expand Up @@ -569,7 +569,7 @@ if ARGUMENTS.get('VERBOSE') == "1":
del options['CCCOMSTR']
del options['LINKCOMSTR']

# Actually instance the Environement with all collected information:
# Actually instance the Environment with all collected information:
env = Environment(**options)
Export('env')

Expand Down
2 changes: 1 addition & 1 deletion docs/_static/benchmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/rmlint.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ General Options
Examples::

$ rmlint -o json # Stream the json output to stdout
$ rmlint -O csv:/tmp/rmlint.csv # Output an extra csv fle to /tmp
$ rmlint -O csv:/tmp/rmlint.csv # Output an extra csv file to /tmp

:``-c --config=spec[=value]`` (**default\:** *none*):

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ as possible! Good practice includes adding a ``$`` anchor at the end of the rege
.. code-block:: bash
# Sort paths with ABC in them first, then DEF, then GHI.
# Everthing with »temp«, »tmp« or »cache« in it comes last,
# Everything with »temp«, »tmp« or »cache« in it comes last,
# the rest is sandwhiched in between and sorted by their modification time (m).
# If something is tied, the modification time is also used a sorting criteria.
$ rmlint -S 'r<.*ABC.*>r<.*DEF.*>r<.*GHI.*>R<.*(tmp|temp|cache).*>m' /tmp/t
Expand Down Expand Up @@ -735,7 +735,7 @@ Replaying results
Often it is useful to just re-output the results you got from ``rmlint``.
That's kind of annoying for large datasets, especially when you have big files.
For this, ``rmlint`` features a special mode, where it re-outputs the result of
previous runs. By default, ``rmlint`` will spit out a ``.json`` file (ususally
previous runs. By default, ``rmlint`` will spit out a ``.json`` file (usually
called ``rmlint.json``). When ``--replay`` is given, you can pass one or more
of those ``.json`` files to the commandline as they would be normal
directories. ``rmlint`` will then merge and re-output then. Note however, that
Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def do_activate(self, **kw):
def do_startup(self, **kw):
Gtk.Application.do_startup(self, **kw)

# Make tranlsating strings possible:
# Make translating strings possible:
# (We use the same message catalouge as rmlint)
gettext.install('rmlint')

Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def on_draw(self, area, ctx):
# Figure out the background color of the drawing area
alloc = area.get_allocation()

# Caluclate the font size of the inner label.
# Calculate the font size of the inner label.
# Make it smaller if not enough place but cut off at a size of 12
inner_circle = (1.4 / max_layers)
inner_circle *= min(alloc.width, alloc.height) / 2
Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def parse_count(value):

def parse(query):
"""Actual lowlevel parsing function.
Extracts arbitary text and attr-value pairs.
Extracts arbitrary text and attr-value pairs.
"""
attrs = ATTR_PATTERN.finditer(query)
results = defaultdict(list)
Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def __init__(self, settings, untagged_paths, tagged_paths):

def on_process_termination(self, process, result):
"""Called once GSuprocess sees its child die."""
# We dont emit process-finished yet here.
# We don't emit process-finished yet here.
# We still might get some items from the stream.
# Call process-finished once we hit EOF.

Expand Down
16 changes: 8 additions & 8 deletions gui/shredder/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
to make the ui rendering as fluid as possible by making most of the costly
operations non-blocking.
Most of the code should be very clean but some vodoo is hidden.
Most of the code should be very clean but some voodoo is hidden.
If you don't find it, that's good. If you do, blame @sahib.
"""

Expand Down Expand Up @@ -336,7 +336,7 @@ def resolve(self, iter_path):

def sort(self, column_id, reverse=False, root=None):
"""Sort the trie nodes by their value in at `column_id`.
If reverse is True, biger values appear first.
If reverse is True, bigger values appear first.
This implementation is a generator that yields
each visited node after sorting and a mapping from
Expand Down Expand Up @@ -428,7 +428,7 @@ def __init__(self, paths):
GLib.timeout_add(1000, self._update_intermediate_nodes)

# A node was updated from the outside, i.e. by another model,
# or by directly modifiying a PathNode or PathTrie.
# or by directly modifying a PathNode or PathTrie.
self.trie.connect('node-updated', self.on_node_updated)

def _update_intermediate_nodes(self):
Expand Down Expand Up @@ -583,7 +583,7 @@ def filter_model(self, term):
return partial_model

###################################
# PyGObject convinience interface #
# PyGObject convenience interface #
###################################

def set_value(self, iter_, column, value):
Expand Down Expand Up @@ -781,12 +781,12 @@ def do_has_default_sort_func(self):
return False

def sort(self, id_, order=Gtk.SortType.ASCENDING):
"""Convinience method for do_set_sort_column_id."""
"""Convenience method for do_set_sort_column_id."""
self.do_set_sort_column_id(id_, order)


def _create_column(title, id_, renderers, fixed_width=100):
"""Convinience method for creating a TreeView Column.
"""Convenience method for creating a TreeView Column.
Several renderers can be given with certain options.
"""
column = Gtk.TreeViewColumn()
Expand Down Expand Up @@ -864,7 +864,7 @@ def set_model(self, model):
self.expand_all()

def get_selected_nodes(self):
"""Extra convinience method for getting the currently selected nodes"""
"""Extra convenience method for getting the currently selected nodes"""
model, rows = self.get_selection().get_selected_rows()
for tp_path in rows:
node = model.trie.resolve(tp_path.get_indices())
Expand Down Expand Up @@ -986,7 +986,7 @@ def on_expand_all(self, _):
self.expand_all()

def on_collapse_all(self, _):
"""Just collpase everything in the tree."""
"""Just collapse everything in the tree."""
self.collapse_all()

def set_twin(self, view):
Expand Down
4 changes: 2 additions & 2 deletions gui/shredder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
into other projects if necessary.
Also included: Various specialised GtkCellRenderer implementation.
Reason for special derivates are given in the respective class.
Reason for special derivatives are given in the respective class.
"""

# Stdlib:
Expand Down Expand Up @@ -888,7 +888,7 @@ def min_value(self):

@min_value.setter
def min_value(self, val):
"""Set the minum value."""
"""Set the minimum value."""
self._min_wdgt.set_bytes(val)

@property
Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/views/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def on_selection_changed(self, _):
filename = self.get_filename()
self.confirm.set_sensitive(bool(filename))

# Make sure the user-typed extension gets set in teh type chooser also.
# Make sure the user-typed extension gets set in the type chooser also.
name = self.get_current_name()
*_, extension = name.rsplit('.', 1)
self.file_type.set_selected_choice(extension)
Expand Down
2 changes: 1 addition & 1 deletion gui/shredder/views/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def __init__(self, app):
self.group_treeview.set_valign(Gtk.Align.FILL)

# This is needed to make sure operations on the one update
# the other. Interally the same nodes are updated, but it has
# the other. Internally the same nodes are updated, but it has
# to be made sure that the models get updated.
self.group_treeview.set_twin(self.treeview)
self.treeview.set_twin(self.group_treeview)
Expand Down
4 changes: 2 additions & 2 deletions lib/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct RmPath {
/* whether to treat all files under path as one filesystem */
bool treat_as_single_vol : 1;

/* wether calling realpath() worked on this path */
/* whether calling realpath() worked on this path */
bool realpath_worked : 1;
} RmPath;

Expand Down Expand Up @@ -127,7 +127,7 @@ typedef struct RmCfg {
* supplied by the user, i.e., the sums of the lengths of
* the associated lists RmCfg::{paths,json_paths}, which is
* not meant to be a useful number to know, and is simply a
* byproduct of calculating path indicies.
* byproduct of calculating path indices.
*/
guint path_count;

Expand Down
2 changes: 1 addition & 1 deletion lib/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const char *rm_digest_type_to_string(RmDigestType type);
RmDigest *rm_digest_new(RmDigestType type, RmOff seed);

/**
* @brief Deallocate memory assocated with a RmDigest.
* @brief Deallocate memory associated with a RmDigest.
*/
void rm_digest_free(RmDigest *digest);

Expand Down
2 changes: 1 addition & 1 deletion lib/checksums/sha3/sha3.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void keccakf(uint64_t s[25]) {
}
}

/* *************************** Public Inteface ************************ */
/* *************************** Public Interface ************************ */

/* For Init or Reset call these: */
void sha3_Init256(sha3_context *ctx) {
Expand Down
8 changes: 4 additions & 4 deletions lib/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void rm_cmd_start_gui(int argc, const char **argv) {
rm_log_warning("\n");
rm_log_error_line("%s %d", g_strerror(errno), errno == ENOENT);
} else {
/* This is not reached anymore when execve suceeded */
/* This is not reached anymore when execve succeeded */
break;
}

Expand Down Expand Up @@ -886,7 +886,7 @@ static gboolean rm_cmd_parse_timestamp_file(const char *option_name,

fclose(stamp_file);
} else {
/* Cannot read a stamp file, assume we gonna creae it. */
/* Cannot read a stamp file, assume we have to create it. */
plain = false;
success = true;
rm_log_info_line(_("No stamp file at `%s`, will create one after this run."), timestamp_path);
Expand Down Expand Up @@ -1333,7 +1333,7 @@ static bool rm_cmd_set_paths(RmSession *session, char **paths) {
static bool rm_cmd_set_outputs(RmSession *session, GError **error) {
if(session->output_cnt[0] >= 0 && session->output_cnt[1] >= 0) {
g_set_error(error, RM_ERROR_QUARK, 0,
_("Specifiyng both -o and -O is not allowed"));
_("Specifying both -o and -O is not allowed"));
return false;
} else if(session->output_cnt[0] < 0 && session->cfg->progress_enabled == false) {
rm_cmd_set_default_outputs(session);
Expand Down Expand Up @@ -1755,7 +1755,7 @@ int rm_cmd_main(RmSession *session) {
g_assert(cfg->cache_file_structs);

/* Currently we cannot use -D and the cloning on btrfs, since this assumes the same layout
* on two dupicate directories which is likely not a valid assumption.
* on two duplicate directories which is likely not a valid assumption.
* Emit a warning if the raw -D is used in conjunction with that.
* */
const char *handler_key = rm_fmt_get_config_value(session->formats, "sh", "handler");
Expand Down
2 changes: 1 addition & 1 deletion lib/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ typedef struct RmFile {
gint64 twin_count;

/* Disk fiemap / physical offset at start of file (tests mapping subsequent
* file fragements did not deliver any significant additionl benefit) */
* file fragments did not deliver any significant additionl benefit) */
RmOff disk_offset;
};

Expand Down
2 changes: 1 addition & 1 deletion lib/formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/* A group of output files.
* These are only created when caching to the end of the run is requested.
* Otherwise, files are directly outputed and not stored in groups.
* Otherwise, files are directly outputted and not stored in groups.
*/
typedef struct RmFmtGroup {
GQueue files;
Expand Down
6 changes: 3 additions & 3 deletions lib/formats.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void rm_fmt_register(RmFmtTable *self, RmFmtHandler *handler);
bool rm_fmt_add(RmFmtTable *self, const char *handler_name, const char *path);

/**
* @brief Make all handlers write a ouput line to their respective file.
* @brief Make all handlers write a output line to their respective file.
*
* The actual content of the line (or even lines) is subject to the
* implementation of the handler - it might also do just nothing.
Expand Down Expand Up @@ -232,7 +232,7 @@ bool rm_fmt_is_valid_key(RmFmtTable *self, const char *formatter, const char *ke
bool rm_fmt_is_a_output(RmFmtTable *self, const char *path);

/**
* @brief Initialize a GHashTableIter with the pairs of registerd
* @brief Initialize a GHashTableIter with the pairs of registered
* paths/handlers.
*
* Call g_hash_table_iter_next() to retrieve the values.
Expand All @@ -254,7 +254,7 @@ void rm_fmt_lock_state(RmFmtTable *self);
void rm_fmt_unlock_state(RmFmtTable *self);

/**
* @brief Check if a certain handler is writting to a stream.
* @brief Check if a certain handler is writing to a stream.
*/
bool rm_fmt_is_stream(RmFmtTable *self, RmFmtHandler *handler);

Expand Down
4 changes: 2 additions & 2 deletions lib/formats/progressbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static void rm_fmt_progress_format_text(
break;
}

/* Support unicode messages - tranlsated text might contain some. */
/* Support unicode messages - translated text might contain some. */
self->text_len = g_utf8_strlen(self->text_buf, self->text_len);

/* Get rid of colors to get the correct length of the text. This is
Expand Down Expand Up @@ -397,7 +397,7 @@ static void rm_fmt_prog(RmSession *session,
}

if(state == RM_PROGRESS_STATE_INIT) {
/* Do initializiation here */
/* Do initialization here */
const char *update_interval_str =
rm_fmt_get_config_value(session->formats, "progressbar", "update_interval");

Expand Down
2 changes: 1 addition & 1 deletion lib/hasher.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const int HASHER_FADVISE_FLAGS = 0
| POSIX_FADV_SEQUENTIAL /* Read from 0 to file-size */
#endif
#ifdef POSIX_FADV_WILLNEED
| POSIX_FADV_WILLNEED /* Tell the kernel to readhead */
| POSIX_FADV_WILLNEED /* Tell the kernel to readahead */
#endif
#ifdef POSIX_FADV_NOREUSE
| POSIX_FADV_NOREUSE /* We will not reuse old data */
Expand Down
2 changes: 1 addition & 1 deletion lib/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static RmFile *rm_parrot_next(RmParrot *polly) {
polly->unpacker
);

/* we cant get rid of the actual directory now */
/* we can't get rid of the actual directory now */
rm_file_destroy(file);

/* call self, which will now read from the unpacker;
Expand Down
2 changes: 1 addition & 1 deletion lib/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void rm_session_acknowledge_abort(const gint abort_count) {
g_mutex_unlock(&m);
}

/* FIDEDUPERANGE supercedes the btrfs-only BTRFS_IOC_FILE_EXTENT_SAME as of Linux 4.5 and
/* FIDEDUPERANGE supersedes the btrfs-only BTRFS_IOC_FILE_EXTENT_SAME as of Linux 4.5 and
* should work for ocfs2 and xfs as well as btrfs. We should still support the older
* btrfs ioctl so that this still works on Linux 4.2 to 4.4. The two ioctl's are
* identical apart from field names so we can use #define's to accommodate both. */
Expand Down
2 changes: 1 addition & 1 deletion lib/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct RmFmtTable;
typedef struct RmSession {
RmCfg *cfg;

/* Stores for RmFile during traversal, preproces and shredder */
/* Stores for RmFile during traversal, preprocess and shredder */
struct RmFileTables *tables;

/* Table of mountpoints used in the system */
Expand Down
8 changes: 4 additions & 4 deletions lib/shredder.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static gulong rm_shred_group_potential_file_count(RmShredGroup *group) {
}
}

/* Governer to limit memory usage by limiting how many RmShredGroups can be
/* Governor to limit memory usage by limiting how many RmShredGroups can be
* active at any one time
* NOTE: group_lock must be held before calling rm_shred_check_paranoid_mem_alloc
*/
Expand Down Expand Up @@ -1223,12 +1223,12 @@ int rm_shred_cmp_orig_criteria(RmFile *a, RmFile *b, RmSession *session) {
(cfg->keep_all_untagged || cfg->must_match_untagged)) {
return (a->is_prefd - b->is_prefd);
} else {
int comparasion = rm_pp_cmp_orig_criteria(a, b, session);
if(comparasion == 0) {
int comparison = rm_pp_cmp_orig_criteria(a, b, session);
if(comparison == 0) {
return b->is_original - a->is_original;
}

return comparasion;
return comparison;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/shredder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ typedef enum RmShredGroupStatus {
void rm_shred_run(RmSession *session);

/**
* @brief Forward a group of files to the outout module.
* @brief Forward a group of files to the output module.
*
* @param session the output module's session.
* @param group a group of dupes that should be reported.
Expand Down
Loading

0 comments on commit 80d465c

Please sign in to comment.