Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
misplaced_files Namespace Reference

Functions

 subsystem (path)
 
 sources ()
 
 build_index ()
 
 main ()
 

Variables

str SRC = 'src'
 
dict LAYER
 
dict NEVER_MOVE
 

Detailed Description

Find files that live in the wrong directory.

A file whose only consumers are in ONE other subsystem is not shared infrastructure --
it belongs to that subsystem. This reports those, and refuses to report the ones that
would merely move the problem.

Two checks make the difference between a useful list and a misleading one:

  * SIBLING USE. A header used by `iop/` looks like an `iop/` file until you notice that
    three files in its own directory also use it. Moving it alone then creates a new
    layering inversion where there was none. Such files are reported separately as
    "cluster" candidates: they can only move together with the siblings that use them.

  * LAYER DIRECTION. Moving a file UP the layer stack (common/ -> iop/) removes an
    inversion. Moving it DOWN would create one. Only the former is proposed.

Usage:
  python3 tools/misplaced_files.py                 # every source directory
  python3 tools/misplaced_files.py --dir common    # one directory
  python3 tools/misplaced_files.py --clusters      # show the blocked ones and why

Function Documentation

◆ build_index()

misplaced_files.build_index ( )

Definition at line 54 of file misplaced_files.py.

References sources().

Referenced by main().

◆ main()

misplaced_files.main ( void  )

Definition at line 75 of file misplaced_files.py.

References build_index(), main(), and subsystem().

Referenced by main().

◆ sources()

misplaced_files.sources ( )

Definition at line 44 of file misplaced_files.py.

Referenced by build_index().

◆ subsystem()

misplaced_files.subsystem (   path)

Definition at line 39 of file misplaced_files.py.

Referenced by main().

Variable Documentation

◆ LAYER

dict misplaced_files.LAYER
Initial value:
1= {'external': 0, 'win': 0, 'system': 0, 'common': 1, 'math': 1, 'colorprofiles': 1, 'pixel': 2, 'control': 3,
2 'gui': 4, 'widgets': 4, # widgets/ = reusable GTK widgets, no app state 'develop': 5,
3 'iop': 6, 'imageio': 6, 'libs': 7, 'views': 7, 'chart': 7,
4 'apps': 10, # executables link the orchestrator, so they sit ABOVE it 'app': 9}

Definition at line 29 of file misplaced_files.py.

◆ NEVER_MOVE

dict misplaced_files.NEVER_MOVE
Initial value:
1= {'module_api.h', 'view_api.h', 'lib_api.h', 'imageio_format_api.h',
2 'imageio_storage_api.h', 'poison.h', 'win.h', 'darktable.h', 'config.h'}

Definition at line 35 of file misplaced_files.py.

◆ SRC

str misplaced_files.SRC = 'src'

Definition at line 28 of file misplaced_files.py.