MCPcopy Index your code

hub / github.com/sqlfluff/sqlfluff / functions

Functions2,340 in github.com/sqlfluff/sqlfluff

↓ 10 callersMethodnum_violations
Count the number of violations in the path.
src/sqlfluff/core/linter/linted_dir.py:176
↓ 10 callersFunctionoffset_slice
Construct a slice from a start and offset.
src/sqlfluff/core/helpers/slice.py:27
↓ 10 callersMethodprocess
Compile a dbt model and return the compiled SQL. Args: fname: Path to dbt model(s) in_str: fname contents using confi
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:538
↓ 10 callersMethodref
Return an object which acts as a late binding reference to the element named. NB: This requires the dialect to be expanded, and only returns
src/sqlfluff/core/dialects/base.py:286
↓ 9 callersFunction_count_lt01
(results: list[dict])
test/rules/std_LT01_jinja_alignment_test.py:13
↓ 9 callersMethodclose
Close output file.
src/sqlfluff/cli/outputstream.py:57
↓ 9 callersMethodfrom_around_target
Generate a sequence around a target. Args: target_segment (:obj:`RawSegment`): The segment to center around when
src/sqlfluff/utils/reflow/sequence.py:229
↓ 9 callersFunctionget_keywords
Get a list of keywords of the required type. keyword_type should be one of "not-keyword", "reserved", "non-reserved"
src/sqlfluff/dialects/dialect_postgres_keywords.py:41
↓ 9 callersMethodget_parent
Get the parent segment, with some validation. This is provided as a performance optimisation when searching through the syntax tree.
src/sqlfluff/core/parser/segments/base.py:762
↓ 9 callersMethodis_type
Is this segment (or its parent) of the given type.
src/sqlfluff/core/parser/segments/base.py:798
↓ 9 callersMethodis_whitespace
Return True if this segment is whitespace.
src/sqlfluff/core/parser/segments/raw.py:109
↓ 9 callersMethodload
Raise an exception on load.
test/core/plugin_test.py:105
↓ 9 callersMethodparse
Parse a series of lexed tokens using the Rust parser. This method now uses the MatchResult-based approach where Rust returns
src/sqlfluff/core/parser/rust_parser.py:110
↓ 9 callersFunctionparse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/reindent_test.py:32
↓ 9 callersMethodprocess_inline_config
Process an inline config command and update self. Args: config_line (str): The inline config section to be processed.
src/sqlfluff/core/config/fluffconfig.py:662
↓ 9 callersFunctionskip_start_index_forward_to_code
Move an index forward through segments until segments[index] is code.
src/sqlfluff/core/parser/match_algorithms.py:18
↓ 9 callersFunctionsplit_comma_separated_string
Converts comma separated string to List, stripping whitespace.
src/sqlfluff/core/helpers/string.py:81
↓ 9 callersMethodtype_set
Return a set of the types contained, mostly for testing.
src/sqlfluff/core/parser/segments/base.py:1018
↓ 8 callersFunction_indent_description
Construct a human readable description of the indent. NOTE: We operate assuming that the "correct" indent is never a mix of tabs and spaces.
src/sqlfluff/utils/reflow/elements.py:229
↓ 8 callersMethodfrom_config
Construct a `ParseContext` from a `FluffConfig`. Args: config (FluffConfig): The configuration object. Returns:
src/sqlfluff/core/parser/context.py:119
↓ 8 callersMethodfrom_point
Convenience method for creating point markers.
src/sqlfluff/core/parser/markers.py:86
↓ 8 callersFunctionget_linter_and_formatter
Get a linter object given a config.
src/sqlfluff/cli/commands.py:541
↓ 8 callersMethodget_results
Return the current result buffer.
src/sqlfluff/utils/reflow/sequence.py:97
↓ 8 callersMethodis_code
Return True if this segment is code.
src/sqlfluff/core/parser/segments/raw.py:99
↓ 8 callersMethoditer_segments
Iterate segments, optionally expanding some children.
src/sqlfluff/core/parser/segments/base.py:1001
↓ 8 callersMethodlint_string_wrapped
Lint strings directly.
src/sqlfluff/core/linter/linter.py:1099
↓ 8 callersFunctionpct
(val: float)
utils/compare_parser_metrics.py:349
↓ 8 callersMethodprocess
Process a string and return a TemplatedFile. Note that the arguments are enforced as keywords because Templaters can have differences
src/sqlfluff/core/templaters/base.py:545
↓ 8 callersMethodprocess
Process a string and return a TemplatedFile. Note that the arguments are enforced as keywords because Templaters can have differences
src/sqlfluff/core/templaters/placeholder.py:119
↓ 8 callersMethodrespace_point
Respace a point based on given constraints. NB: This effectively includes trailing whitespace fixes. Deletion and edit fixes are gen
src/sqlfluff/utils/reflow/elements.py:688
↓ 8 callersMethodreversed
Return the same segments in reverse order.
src/sqlfluff/utils/functional/segments.py:69
↓ 8 callersMethodroot_variant
Returns the root variant if successfully parsed, otherwise None.
src/sqlfluff/core/linter/common.py:120
↓ 8 callersMethodstart_point_marker
Get a point marker from the start.
src/sqlfluff/core/parser/markers.py:211
↓ 7 callersMethod_cs_str_id
(self, identifier: BaseSegment)
src/sqlfluff/rules/aliasing/AL05.py:187
↓ 7 callersFunction_resolve_path
Resolves a path relative to the directory of filepath. Handles both exact paths and wildcard patterns.
src/sqlfluff/core/config/file.py:45
↓ 7 callersFunctionclean_rst_markup
Remove RST-style markup from text. Args: text: Text containing RST markup Returns: Cleaned text
docsv/scripts/generate-api-docs.py:22
↓ 7 callersFunctionfixes_from_results
Return a list of fixes from an iterable of LintResult.
src/sqlfluff/utils/reflow/helpers.py:16
↓ 7 callersMethodformat_filename
Format filenames.
src/sqlfluff/cli/formatters.py:404
↓ 7 callersMethodget_indent
Get the current indent (if there).
src/sqlfluff/utils/reflow/elements.py:357
↓ 7 callersMethodget_indent_impulse
Get the change in intended indent balance from this point.
src/sqlfluff/utils/reflow/elements.py:409
↓ 7 callersMethodget_line_pos_of_char_pos
Get the line number and position of a point in the source file. Args: char_pos: The character position in the relevant file.
src/sqlfluff/core/templaters/base.py:251
↓ 7 callersFunctionget_select_statement_info
Analyze a select statement: targets, aliases, etc. Return info.
src/sqlfluff/utils/analysis/select.py:86
↓ 7 callersFunctionmake_output_stream
Create and return appropriate OutputStream instance.
src/sqlfluff/cli/outputstream.py:62
↓ 7 callersFunctionnested_combine
Combine an iterable of dictionaries. Each dictionary is combined into a result dictionary. For each key in the first dictionary, it will be o
src/sqlfluff/core/helpers/dict.py:25
↓ 7 callersFunctionrecords_to_nested_dict
Reconstruct records into a dict. >>> records_to_nested_dict( ... [(("foo", "bar", "baz"), "a"), (("foo", "bar", "biz"), "b")] ... )
src/sqlfluff/core/helpers/dict.py:141
↓ 7 callersFunctionslice_length
Get the length of a slice.
src/sqlfluff/core/helpers/slice.py:10
↓ 7 callersMethodsource_str
Returns the string in the source at this position.
src/sqlfluff/core/parser/markers.py:285
↓ 6 callersFunction_ensure_pytest
Ensure pytest is available for testing functions.
src/sqlfluff/utils/testing/rules.py:30
↓ 6 callersMethod_get_parse_mode
Extract ParseMode from grammar.
utils/build_parsers.py:238
↓ 6 callersMethod_get_tag_configuration
Return information about the behaviors of a tag.
src/sqlfluff/core/templaters/slicers/tracer.py:383
↓ 6 callersFunction_pos_col
Return the column (position) in the chosen coordinate space. Args: pm: Position marker to get column from. use_source: If True, u
src/sqlfluff/utils/reflow/respace.py:54
↓ 6 callersMethodcheck_tuples_by_path
Fetch all check_tuples from all contained `LintedDir` objects. Returns: A dict, with lists of tuples grouped by path.
src/sqlfluff/core/linter/linted_dir.py:158
↓ 6 callersMethodconstruct_render_func
Builds and returns objects needed to create and run templates. Args: fname (Optional[str]): The name of the file. con
src/sqlfluff/core/templaters/jinja.py:617
↓ 6 callersMethoddedupe_tuple
Generate a tuple of this fix for deduping.
src/sqlfluff/core/linter/patch.py:30
↓ 6 callersMethoddispatch_config
Dispatch configuration output appropriately.
src/sqlfluff/cli/formatters.py:153
↓ 6 callersFunctionformat_type_hint
Format a type hint for display. Args: hint: Type hint object Returns: Formatted string representation
docsv/scripts/generate-api-docs.py:266
↓ 6 callersMethodformat_violation
Format a violation. NOTE: This method accepts both SQLBaseError objects and the serialised dict representation. If the former is pass
src/sqlfluff/cli/formatters.py:439
↓ 6 callersFunctionget_encoding
Get the encoding of the file (autodetect).
src/sqlfluff/core/helpers/file.py:12
↓ 6 callersMethodget_rules
Get plugin rules.
src/sqlfluff/core/plugin/hookspecs.py:23
↓ 6 callersFunctionget_ruleset
Get a ruleset by name.
src/sqlfluff/core/rules/__init__.py:33
↓ 6 callersMethodget_segment
Allow access to segments pre-expansion. This is typically for dialect inheritance. This method also validates that the result is a se
src/sqlfluff/core/dialects/base.py:268
↓ 6 callersMethodis_raw
Return True if this segment has no children.
src/sqlfluff/core/parser/segments/base.py:1025
↓ 6 callersFunctionis_type
Returns a function that determines if segment is one of the types.
src/sqlfluff/utils/functional/segment_predicates.py:38
↓ 6 callersFunctioniter_intermediate_paths
Iterate paths between two given paths. If the `inner_path` is a subdirectory of the `outer_path` then all steps in between the two are yielde
src/sqlfluff/core/helpers/file.py:36
↓ 6 callersMethoditer_partials
Iterate through partials for linted files. Generates filenames and objects which return LintedFiles.
src/sqlfluff/core/linter/runner.py:60
↓ 6 callersFunctionload_config_at_path
Load config files at a given path. Args: path (str): The directory to search for config files. Returns: :obj:`ConfigMappingT
src/sqlfluff/core/config/loader.py:204
↓ 6 callersFunctionload_config_file
Load a config file from the filesystem. Args: file_dir (str): The path to the location of file to be loaded. This should be a
src/sqlfluff/core/config/loader.py:107
↓ 6 callersFunctionload_ini_string
Read an ini-style config string. This would include loading a `.sqlfluff` file. Notes: - We rename the root `sqlfluff` section, to `core
src/sqlfluff/core/config/ini.py:35
↓ 6 callersMethodmatch
Match against this matcher.
src/sqlfluff/core/parser/parsers.py:160
↓ 6 callersMethodmatch
Match against this matcher. NOTE: We check that the segment is also code to avoid matching unexpected comments.
src/sqlfluff/core/parser/parsers.py:208
↓ 6 callersMethodmatch
Match a specific sequence of elements. When returning incomplete matches in one of the greedy parse modes, we don't return any new me
src/sqlfluff/core/parser/grammar/sequence.py:117
↓ 6 callersFunctionnormalise_paths
Test normalising paths. NB Paths on difference platforms might look different, so this makes them comparable.
test/core/linter/discovery_test.py:11
↓ 6 callersFunctionpad_line
Pad a string with a given alignment to a specific width with spaces.
src/sqlfluff/cli/helpers.py:66
↓ 6 callersFunctionpretty_segment_name
Get a nicely formatted name of the segment.
src/sqlfluff/utils/reflow/helpers.py:21
↓ 6 callersMethodpretty_target_name
Get a nicely formatted name of the target.
src/sqlfluff/utils/reflow/rebreak.py:95
↓ 6 callersMethodprocess
Process a string and return a TemplatedFile. Note that the arguments are enforced as keywords because Templaters can have differences
src/sqlfluff/core/templaters/python.py:211
↓ 6 callersMethodrebreak
Returns a new :obj:`ReflowSequence` corrected line breaks. This intentionally **does not handle indentation**, as the existing indent
src/sqlfluff/utils/reflow/sequence.py:557
↓ 6 callersMethodrecursive_crawl_all
Recursively crawl all descendant segments.
src/sqlfluff/utils/functional/segments.py:104
↓ 6 callersMethodreindent
Reindent lines within a sequence.
src/sqlfluff/utils/reflow/sequence.py:605
↓ 6 callersMethodrender_string
Template the file.
src/sqlfluff/core/linter/linter.py:918
↓ 6 callersMethodseed_parse_nodes
Seed the current node budget from an existing segment count.
src/sqlfluff/core/parser/context.py:161
↓ 6 callersMethodsimple
Does this matcher support a uppercase hash matching route? A ref is simple, if the thing it references is simple.
src/sqlfluff/core/parser/grammar/base.py:357
↓ 6 callersMethodstructural_simplify
Simplify the structure recursively so it serializes nicely in json/yaml. This is used in the .as_record() method.
src/sqlfluff/core/parser/segments/base.py:618
↓ 5 callersFunction_check_ignore_specs
Check a filepath against the loaded ignore files. Returns: The path of an ignorefile if found, None otherwise.
src/sqlfluff/core/linter/discovery.py:39
↓ 5 callersFunction_get_object_references
( segment: BaseSegment, exclude_ids: Optional[set[int]] = None, )
src/sqlfluff/utils/analysis/select.py:68
↓ 5 callersMethod_get_project_dir
Get the dbt project directory from the configuration. Defaults to the working directory.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:393
↓ 5 callersMethod_get_target_path
Get a dbt target path from the configuration.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:427
↓ 5 callersFunction_has_keyword
Check if a keyword exists among direct child segments.
src/sqlfluff/rules/postgres/PG01.py:9
↓ 5 callersMethod_parse_noqa
Extract ignore mask entries from a comment string.
src/sqlfluff/core/rules/noqa.py:65
↓ 5 callersMethod_resolve_ref
Resolve potential string references to things we can match against.
src/sqlfluff/core/parser/grammar/base.py:87
↓ 5 callersFunctionclear_config_caches
Clear any of the cached config methods. This is primarily used during testing where the cache may be be rendered unreliable by using moving a
src/sqlfluff/core/config/__init__.py:35
↓ 5 callersMethodcolorize_helper
Static version of colorize() method.
src/sqlfluff/cli/formatters.py:288
↓ 5 callersMethodcrawl_sources
Find SELECTs, table refs, or value table function calls in segment. For each SELECT, yield a list of Query objects. As we find table
src/sqlfluff/utils/analysis/query.py:222
↓ 5 callersMethodfrom_dict
Construct a ReflowConfig from a dict.
src/sqlfluff/utils/reflow/config.py:89
↓ 5 callersFunctionfunc
(x)
test/core/templaters/builtins_test.py:13
↓ 5 callersMethodget_depth_info
Get the depth info for a given segment.
src/sqlfluff/utils/reflow/depthmap.py:158
↓ 5 callersMethodget_fixes
Get the current fix buffer. We're hydrating them here directly from the LintResult objects, so for more accurate results, consider us
src/sqlfluff/utils/reflow/sequence.py:87
↓ 5 callersMethodget_raw_segments
Iterate raw segments, mostly for searching.
src/sqlfluff/core/parser/segments/raw.py:159
↓ 5 callersMethodget_root_segment
Get the root segment of the dialect.
src/sqlfluff/core/dialects/base.py:397
↓ 5 callersMethodget_rulepack
Use the config to return the appropriate rules. We use the config both for allowlisting and denylisting, but also for configuring the
src/sqlfluff/core/rules/base.py:1098
← previousnext →101–200 of 2,340, ranked by callers