Skip to content

Commit

Permalink
editorconfig: add setting to trim trailing whitespace
Browse files Browse the repository at this point in the history
and clean up all outstanding issues

Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
  • Loading branch information
eli-schwartz committed Aug 15, 2021
1 parent c2592bc commit 59d4f77
Show file tree
Hide file tree
Showing 156 changed files with 89 additions and 216 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ root = true
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = true

[*.[ch]]
indent_size = 4
Expand Down
1 change: 0 additions & 1 deletion cross/iphone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ system = 'darwin'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

1 change: 0 additions & 1 deletion cross/tvos.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ system = 'darwin'
cpu_family = 'arm'
cpu = 'arm64'
endian = 'little'

1 change: 0 additions & 1 deletion cross/wasm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ system = 'emscripten'
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'

1 change: 0 additions & 1 deletion data/shell-completions/zsh/_meson
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,3 @@ ret=$?
esac

return ret

2 changes: 1 addition & 1 deletion docs/markdown/Adding-new-projects-to-wrapdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ git commit -a -m 'Add wrap files for libfoo-1.0.0'
git push -u origin libfoo
```

Now you should create a pull request on GitHub.
Now you should create a pull request on GitHub.

If packaging review requires you to do changes, use the `--amend`
argument to `commit` so that your branch will have only one commit.
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Builds a default or a specified target of a configured Meson project.
- `NAME`: name of the target from `meson.build` (e.g. `foo` from `executable('foo', ...)`).
- `PATH`: path to the target relative to the root `meson.build` file. Note: relative path for a target specified in the root `meson.build` is `./`.
- `TYPE`: type of the target. Can be one of the following: 'executable', 'static_library', 'shared_library', 'shared_module', 'custom', 'run', 'jar'.

`PATH` and/or `TYPE` can be omitted if the resulting `TARGET` can be
used to uniquely identify the target in `meson.build`.

Expand Down
10 changes: 5 additions & 5 deletions docs/markdown/Getting-meson_ptbr.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Obtendo o Meson

Meson é implementado em Python 3, e requer a versão 3.6 ou mais nova.
Meson é implementado em Python 3, e requer a versão 3.6 ou mais nova.
se o seu sistema operacional provê um gerenciador de pacotes, você deve
instalar o Meson com ele. Para plataformas que não tem um gerenciador de
pacotes, você precisa baixa-lo da [página inicial do Python]. Veja abaixo
Expand All @@ -26,7 +26,7 @@ plataformas.
O Meson está disponível no [Indice de Pacotes do Python] e pode ser instalado com
`sudo pip3 install meson` que requer root e vai instala-lo para todo o sistema.

Se você já baixou uma cópia do código do Meson, você pode instalar com
Se você já baixou uma cópia do código do Meson, você pode instalar com
`sudo pip3 install path/to/source/root/`.

Como alternativa, você pode usar o `pip3 install --user meson` que vai instalar
Expand Down Expand Up @@ -54,7 +54,7 @@ Clang, Visual Studio, MinGW, ICC, ARMCC, etc.
Você deve usar a versão provida pelo seu gerenciador de pacotes se possível, caso contrário,
baixe o binário executável da [página de *release* do projeto Ninja](https://github.com/ninja-build/ninja/releases).

Se você apenas usa o *backend* do Visual Studio (`--backend=vs`) para gerar soluções do Visual Studio no Windows ou o
Se você apenas usa o *backend* do Visual Studio (`--backend=vs`) para gerar soluções do Visual Studio no Windows ou o
*backend* do XCode (`--backend=xcode`) para gerar projetos no macOS, você não precisa do Ninja.


Expand All @@ -72,15 +72,15 @@ que você selecione as opções do instalador como a seguir:

![passo 3 do instalador](images/py3-install-3.png "Opções Avançadas: ative 'Instalar para todos usuários'")

Com isso, você terá o `python` e o `pip` no `PATH`, e você poderá instalar o Meson com o pip. Você também vai poder
Com isso, você terá o `python` e o `pip` no `PATH`, e você poderá instalar o Meson com o pip. Você também vai poder
executar o comando `meson` em qualquer shell no Windows ao invés de ter que executar `py -3` com o caminho completo para
o *script* `meson.py`.

## Peculiaridades do Python 3 no MSYS2

Se você está usando o MSYS2 no Windows como seu ambiente de desenvolvimento,
por favor se certifique que você não esteja usando o pacote `msys/python` para
fornecer o Python 3. Uso o `mingw32/mingw-w64-i686-python3` ou o
fornecer o Python 3. Uso o `mingw32/mingw-w64-i686-python3` ou o
If you are using MSYS2 on Windows as your development environment,
please make sure that you **do not use** the `msys/python` package to
provide Python 3. Use either `mingw32/mingw-w64-i686-python3` or `mingw64/mingw-w64-x86_64-python3`
Expand Down
13 changes: 6 additions & 7 deletions docs/markdown/Release-notes-for-0.57.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Run Time Checking can be enabled by manually adding `/RTC1` or other RTC flags o

The `debug` buildtype for clang-cl added additional arguments compared to MSVC, which had more to do with optimization than debug. The arguments removed are `/Ob0`, `/Od`, `/RTC1`. (`/Zi` was also removed, but it is already added by default when debug is enabled.)

If these are important issues for you and would like builtin toggle options,
If these are important issues for you and would like builtin toggle options,
please file an issue in the Meson bug tracker.

## Buildtype remains even if dependent options are changed
Expand Down Expand Up @@ -154,17 +154,17 @@ Currently supports `glib-compile-schemas`, `gio-querymodules`, and

## "Edit and continue" (/ZI) is no longer used by default for Visual Studio

Meson was adding the `/ZI` compiler argument as an argument for Visual Studio
in debug mode. This enables the `edit-and-continue` debugging in
Meson was adding the `/ZI` compiler argument as an argument for Visual Studio
in debug mode. This enables the `edit-and-continue` debugging in
Visual Studio IDE's.

Unfortunately, it is also extremely expensive and breaks certain use cases such
as link time code generation. Edit and continue can be enabled by manually by
Unfortunately, it is also extremely expensive and breaks certain use cases such
as link time code generation. Edit and continue can be enabled by manually by
adding `/ZI` to compiler arguments.

The `/ZI` argument has now been replaced by the `/Zi` argument for debug builds.

If this is an important issue for you and would like a builtin toggle option,
If this is an important issue for you and would like a builtin toggle option,
please file an issue in the Meson bug tracker.

## Minimum required Python version updated to 3.6
Expand Down Expand Up @@ -357,4 +357,3 @@ also allows `//` as the id. This way, `meson rewrite kwargs set project

All keys of the `configuration_data` object can be obtained with the `keys()`
method as an alphabetically sorted array.

3 changes: 1 addition & 2 deletions docs/markdown/Release-notes-for-0.58.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ argument that will be separated by space.
## Specify man page locale during installation

Locale directories can now be passed to `install_man`:

```meson
# instead of
# install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')`
Expand Down Expand Up @@ -354,4 +354,3 @@ The `b_sanitize` option for enabling Address sanitizer now works with
the Visual Studio compilers. This requires [a sufficiently new version
of Visual
Studio](https://devblogs.microsoft.com/cppblog/address-sanitizer-for-msvc-now-generally-available/).

3 changes: 1 addition & 2 deletions docs/markdown/Release-notes-for-0.59.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if intl_found
conf.set('ENABLE_NLS', 1)
endif
```

one may simply use:

```
Expand Down Expand Up @@ -232,4 +232,3 @@ the cache upon installation. Most applications do that using a custom script,
but it can now be done by Meson directly.

See [`gnome.post_install()`](Gnome-module.md#gnomepost_install).

1 change: 0 additions & 1 deletion manual tests/4 standalone binaries/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ script.
On Linux you must build the package on the oldest distribution you
plan to support (Debian stable/oldstable and old CentOS are the common
choice here).

30 changes: 15 additions & 15 deletions mesonbuild/backend/xcodebackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def generate_pbx_aggregate_target(self, objects_dict):
target_dependencies = list(map(lambda t: self.pbx_dep_map[t], self.build_targets))
custom_target_dependencies = [self.pbx_custom_dep_map[t] for t in self.custom_targets]
aggregated_targets = []
aggregated_targets.append((self.all_id, 'ALL_BUILD',
aggregated_targets.append((self.all_id, 'ALL_BUILD',
self.all_buildconf_id,
[],
[self.regen_dependency_id] + target_dependencies + custom_target_dependencies))
Expand All @@ -554,7 +554,7 @@ def generate_pbx_aggregate_target(self, objects_dict):
build_phases = []
dependencies = [self.regen_dependency_id]
generator_id = 0
for s in t.sources:
for s in t.sources:
if not isinstance(s, build.GeneratedList):
continue
build_phases.append(self.shell_targets[(tname, generator_id)])
Expand Down Expand Up @@ -602,15 +602,15 @@ def generate_pbx_build_file(self, objects_dict):
if s.is_built:
in_build_dir = True
s = os.path.join(s.subdir, s.fname)

if not isinstance(s, str):
continue
sdict = PbxDict()
k = (tname, s)
idval = self.buildfile_ids[k]
fileref = self.fileref_ids[k]
if in_build_dir:
fullpath = os.path.join(self.environment.get_build_dir(), s)
fullpath = os.path.join(self.environment.get_build_dir(), s)
else:
fullpath = os.path.join(self.environment.get_source_dir(), s)
compiler_args = ''
Expand Down Expand Up @@ -644,7 +644,7 @@ def generate_pbx_build_file(self, objects_dict):
for g in t.generated:
if not isinstance(g, build.GeneratedList):
continue
self.create_generator_shellphase(objects_dict, tname, generator_id)
self.create_generator_shellphase(objects_dict, tname, generator_id)
generator_id += 1

# Custom targets are shell build phases in Xcode terminology.
Expand All @@ -661,7 +661,7 @@ def generate_pbx_build_file(self, objects_dict):
for g in t.sources:
if not isinstance(g, build.GeneratedList):
continue
self.create_generator_shellphase(objects_dict, tname, generator_id)
self.create_generator_shellphase(objects_dict, tname, generator_id)
generator_id += 1

def create_generator_shellphase(self, objects_dict, tname, generator_id):
Expand Down Expand Up @@ -752,7 +752,7 @@ def generate_pbx_file_reference(self, objects_dict):
name = os.path.basename(o)
objects_dict.add_item(ref_id, odict, o)
xcodetype = self.get_xcodetype(o)
rel_name = mesonlib.relpath(o, self.environment.get_source_dir())
rel_name = mesonlib.relpath(o, self.environment.get_source_dir())
odict.add_item('isa', 'PBXFileReference')
odict.add_item('explicitFileType', '"' + xcodetype + '"')
odict.add_item('fileEncoding', '4')
Expand All @@ -773,7 +773,7 @@ def generate_pbx_file_reference(self, objects_dict):
o = os.path.join(t.subdir, o)
fullpath = os.path.join(self.environment.get_source_dir(), o)
idval = self.fileref_ids[(tname, o)]
rel_name = mesonlib.relpath(fullpath, self.environment.get_source_dir())
rel_name = mesonlib.relpath(fullpath, self.environment.get_source_dir())
o_dict = PbxDict()
name = os.path.basename(o)
objects_dict.add_item(idval, o_dict, fullpath)
Expand Down Expand Up @@ -974,7 +974,7 @@ def write_group_target_entry(self, objects_dict, t):
target_children.add_item(self.fileref_ids[(tid, s)], s)
for o in t.objects:
if isinstance(o, build.ExtractedObjects):
# Do not show built object files in the project tree.
# Do not show built object files in the project tree.
continue
if isinstance(o, mesonlib.File):
o = os.path.join(o.subdir, o.fname)
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def generate_pbx_native_target(self, objects_dict):
dep_array.add_item(self.pbx_custom_dep_map[o.get_id()], o.name)
elif isinstance(o, build.CustomTargetIndex):
dep_array.add_item(self.pbx_custom_dep_map[o.target.get_id()], o.target.name)

generator_id += 1

ntarget_dict.add_item('name', f'"{tname}"')
Expand Down Expand Up @@ -1353,7 +1353,7 @@ def generate_xc_build_configuration(self, objects_dict):
warn_array = PbxArray()
warn_array.add_item('"$(inherited)"')
settings_dict.add_item('WARNING_CFLAGS', warn_array)

bt_dict.add_item('name', f'"{buildtype}"')

# Then the test target.
Expand Down Expand Up @@ -1410,7 +1410,7 @@ def determine_internal_dep_link_args(self, target, buildtype):
dep_libs += sub_libs
links_dylib = links_dylib or sub_links_dylib
return (dep_libs, links_dylib)

def generate_single_build_target(self, objects_dict, target_name, target):
for buildtype in self.buildtypes:
dep_libs = []
Expand Down Expand Up @@ -1444,7 +1444,7 @@ def generate_single_build_target(self, objects_dict, target_name, target):
product_name = target.get_basename()
ldargs += target.link_args
# Swift is special. Again. You can't mix Swift with other languages
# in the same target. Thus for Swift we only use
# in the same target. Thus for Swift we only use
if self.is_swift_target(target):
linker, stdlib_args = target.compilers['swift'], []
else:
Expand All @@ -1468,7 +1468,7 @@ def generate_single_build_target(self, objects_dict, target_name, target):
generator_id = 0
for o in target.generated:
if isinstance(o, build.GeneratedList):
outputs = self.generator_outputs[target_name, generator_id]
outputs = self.generator_outputs[target_name, generator_id]
generator_id += 1
for o_abs in outputs:
if o_abs.endswith('.o') or o_abs.endswith('.obj'):
Expand Down Expand Up @@ -1701,7 +1701,7 @@ def generate_prefix(self, pbxdict):
pbxdict.add_item('objectVersion', '46')
objects_dict = PbxDict()
pbxdict.add_item('objects', objects_dict)

return objects_dict

def generate_suffix(self, pbxdict):
Expand Down
1 change: 0 additions & 1 deletion mesonbuild/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,4 +1224,3 @@ def add_to_argparse(self, name: str, parser: argparse.ArgumentParser, help_suffi
'dist': None,
'distcheck': None,
}

4 changes: 2 additions & 2 deletions mesonbuild/dependencies/pkgconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ def _search_libs(self, out: str, out_raw: str) -> T.Tuple[T.List[str], T.List[st
continue
elif lib.startswith('-l:'):
# see: https://stackoverflow.com/questions/48532868/gcc-library-option-with-a-colon-llibevent-a
# also : See the documentation of -lnamespec | --library=namespec in the linker manual
# also : See the documentation of -lnamespec | --library=namespec in the linker manual
# https://sourceware.org/binutils/docs-2.18/ld/Options.html

# Don't resolve the same -l:libfoo.a argument again
if lib in libs_found:
continue
Expand Down
1 change: 0 additions & 1 deletion mesonbuild/templates/objcpptemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,3 @@ def create_library(self) -> None:
open(lib_objcpp_name, 'w', encoding='utf-8').write(lib_objcpp_template.format(**kwargs))
open(test_objcpp_name, 'w', encoding='utf-8').write(lib_objcpp_test_template.format(**kwargs))
open('meson.build', 'w', encoding='utf-8').write(lib_objcpp_meson_template.format(**kwargs))

1 change: 0 additions & 1 deletion packaging/createpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ def generate_distribution(self):
pg = PkgGenerator()
pg.build_dist()
pg.build_package()

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
configure_file(output : 'blank.txt', configuration : configuration_data())

Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ assert(a.has('WORLD'), 'New config data should have been set')
assert(not b.has('WORLD'), 'New config data set should not affect var copied earlier')

configure_file(output : 'a.h', configuration : a)

1 change: 0 additions & 1 deletion test cases/common/114 skip/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
project('skip', 'c')

error('MESON_SKIP_TEST this test is always skipped.')

1 change: 0 additions & 1 deletion test cases/common/115 subproject project arguments/exe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@
int main(void) {
return 0;
}

1 change: 0 additions & 1 deletion test cases/common/13 pch/c/prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ void func(void) {
int main(void) {
return 0;
}

1 change: 0 additions & 1 deletion test cases/common/13 pch/generated/prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
int main(void) {
return FOO + BAR;
}

1 change: 0 additions & 1 deletion test cases/common/13 pch/withIncludeDirectories/prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ void func(void) {
int main(void) {
return 0;
}

1 change: 0 additions & 1 deletion test cases/common/13 pch/withIncludeFile/prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ void func(void) {
int main(void) {
return 0;
}

2 changes: 2 additions & 0 deletions test cases/common/141 special characters/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[meson.build]
trim_trailing_whitespace = false
1 change: 0 additions & 1 deletion test cases/common/147 simd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ p = executable('simdtest', 'simdchecker.c', 'fallback.c',
link_with : simdlibs)

test('simdtest', p)

1 change: 0 additions & 1 deletion test cases/common/147 simd/simd_sse2.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ void increment_sse2(float arr[4]) {
arr[2] = (float)darr[3];
arr[3] = (float)darr[2];
}

1 change: 0 additions & 1 deletion test cases/common/149 dotinclude/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ project('dotinclude', 'c')

executable('dotproc', 'dotproc.c',
implicit_include_directories : false)

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ int func2(void);
#endif

int DLL_PUBLIC func(void) { return func2(); }

Original file line number Diff line number Diff line change
@@ -1 +1 @@

4 changes: 2 additions & 2 deletions test cases/common/169 source in dep/generated/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ genh = custom_target('genh',
input : 'funname',
output : 'funheader.h',
command : [fp, '@INPUT@', '@OUTPUT@'])

dep = declare_dependency(sources : [genh])

e = executable('genuser', 'main.c',
dependencies : dep)
test('genuser', e)
Loading

0 comments on commit 59d4f77

Please sign in to comment.